فهرست منبع

[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