Browse Source

HUE-3570 [notebook] Add a limit 100 to /sql call

Romain Rigaux 9 years ago
parent
commit
330a93a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      desktop/libs/libsolr/src/libsolr/api.py

+ 3 - 0
desktop/libs/libsolr/src/libsolr/api.py

@@ -729,6 +729,9 @@ class SolrApi(object):
 
   def sql(self, collection, statement):
     try:
+      if 'limit' not in statement.lower(): # rows is not supported
+        statement = statement + ' LIMIT 100'
+
       params = self._get_params() + (
           ('wt', 'json'),
           ('rows', 0),