浏览代码

[impala] Don't attempt partition sample query for Impala

Jenny Kim 10 年之前
父节点
当前提交
869f358573
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      apps/beeswax/src/beeswax/server/dbms.py

+ 3 - 1
apps/beeswax/src/beeswax/server/dbms.py

@@ -318,7 +318,9 @@ class HiveServer2Dbms(object):
         select_clause, from_clause = ImpalaDbms.get_nested_select(database, table.name, column, nested)
         select_clause, from_clause = ImpalaDbms.get_nested_select(database, table.name, column, nested)
         hql = 'SELECT %s FROM %s LIMIT %s' % (select_clause, from_clause, limit)
         hql = 'SELECT %s FROM %s LIMIT %s' % (select_clause, from_clause, limit)
     else:
     else:
-      if table.partition_keys:  # Filter on max # of partitions for partitioned tables
+      # Filter on max # of partitions for partitioned tables
+      # Impala's SHOW PARTITIONS is different from Hive, so we only support Hive for now
+      if self.server_name != 'impala' and table.partition_keys:
         hql = self._get_sample_partition_query(database, table, limit)
         hql = self._get_sample_partition_query(database, table, limit)
       else:
       else:
         hql = "SELECT * FROM `%s`.`%s` LIMIT %s" % (database, table.name, limit)
         hql = "SELECT * FROM `%s`.`%s` LIMIT %s" % (database, table.name, limit)