Surface partitions metadata
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'}]
@mistercrunch implemented it.