Browse Source

Table assist max function does not return max value instead also executes sample query with limit 100 #2011 (#2011)

Mahesh Balakrishnan 4 years ago
parent
commit
cc873ae2da
1 changed files with 2 additions and 2 deletions
  1. 2 2
      apps/beeswax/src/beeswax/server/dbms.py

+ 2 - 2
apps/beeswax/src/beeswax/server/dbms.py

@@ -605,9 +605,9 @@ class HiveServer2Dbms(object):
     else:
       if operation == 'distinct':
         hql = "SELECT DISTINCT %s FROM `%s`.`%s` LIMIT %s;" % (column, database, table.name, limit)
-      if operation == 'max':
+      elif operation == 'max':
         hql = "SELECT max(%s) FROM `%s`.`%s`;" % (column, database, table.name)
-      if operation == 'min':
+      elif operation == 'min':
         hql = "SELECT min(%s) FROM `%s`.`%s`;" % (column, database, table.name)
       else:
         hql = "SELECT %s FROM `%s`.`%s` LIMIT %s;" % (column, database, table.name, limit)