<p dir="auto">PyHive provides a nice API to access the partition metadata.<br>
Inspector get_indexes function that provides the indexes and the partition information.<br>
By the way, displaying the indexes is a nice feature too.</p>
<p dir="auto">More information can be found here:<br>
<a href="http://pythonhosted.org/PyHive/pyhive.html#module-pyhive.sqlalchemy_backports" rel="nofollow">http://pythonhosted.org/PyHive/pyhive.html#module-pyhive.sqlalchemy_backports</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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}')

&gt;&gt; [{u'unique': False, u'column_names': [u'ds'], u'name': u'partition'}]"><pre class="notranslate"><code class="notranslate">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}')

&gt;&gt; [{u'unique': False, u'column_names': [u'ds'], u'name': u'partition'}]
</code></pre></div>