Răsfoiți Sursa

[metastore] Provide the partition keys of a table in json

e.g.
$.post('http://127.0.0.1:8000/notebook/api/autocomplete/default/blog', {'snippet': hueDebug.ko.mapping.toJSON({'type': 'hive'})})

If partitions:
"{"status": 0, ... "partition_keys": [{"type": "string", "name": "dy"}, {"type": "string", "name": "dm"}, {"type": "string", "name": "dd"}, {"type": "string", "name": "dh"}]}"

If no partition:
partition_keys": []
Romain Rigaux 10 ani în urmă
părinte
comite
6447fdc
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  1. 1 0
      apps/beeswax/src/beeswax/api.py

+ 1 - 0
apps/beeswax/src/beeswax/api.py

@@ -109,6 +109,7 @@ def _autocomplete(db, database=None, table=None, column=None, nested=None):
       response['hdfs_link'] = t.hdfs_link
       response['columns'] = [column.name for column in t.cols]
       response['extended_columns'] = massage_columns_for_json(t.cols)
+      response['partition_keys'] = [{'name': part.name, 'type': part.type} for part in t.partition_keys]
     else:
       col = db.get_column(database, table, column)
       if col: