superset icon indicating copy to clipboard operation
superset copied to clipboard

Surface partitions metadata

Open jefffeng opened this issue 10 years ago • 2 comments

jefffeng avatar Jul 30 '16 04:07 jefffeng

From: https://github.com/airbnb/caravel/issues/887 PyHive provides a nice API to access the partition metadata. Inspector get_indexes function that provides the indexes and the partition information. By the way, displaying the indexes is a nice feature too.

More information can be found here: http://pythonhosted.org/PyHive/pyhive.html#module-pyhive.sqlalchemy_backports

from sqlalchemy import * from sqlalchemy.engine import create_engine from sqlalchemy.schema import * engine = create_engine('presto://localhost:${port_number}/hive/default') insp = inspect(engine) insp.get_indexes('${table_name}', '${schema_name}')

[{u'unique': False, u'column_names': [u'ds'], u'name': u'partition'}]

bkyryliuk avatar Aug 31 '16 20:08 bkyryliuk

@mistercrunch implemented it.

bkyryliuk avatar Oct 24 '16 16:10 bkyryliuk