瀏覽代碼

[hive] Save one call to the metastore for the table autocomplete

Romain Rigaux 10 年之前
父節點
當前提交
6f2e3fc
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      apps/beeswax/src/beeswax/api.py

+ 3 - 2
apps/beeswax/src/beeswax/api.py

@@ -104,8 +104,9 @@ def _autocomplete(db, database=None, table=None, column=None, nested=None):
     if database is None:
       response['databases'] = db.get_databases()
     elif table is None:
-      response['tables'] = db.get_tables(database=database)
-      response['tables_meta'] = db.get_tables_meta(database=database)
+      tables_meta = db.get_tables_meta(database=database)
+      response['tables'] = [table['name'] for table in tables_meta]
+      response['tables_meta'] = tables_meta
     elif column is None:
       t = db.get_table(database, table)
       response['hdfs_link'] = t.hdfs_link