I have a table that is partitioned on one or more columns. I can do ...
SHOW PARTITIONS table_db.table_1
which gives a list of all partitions like this,
year=2007
year=2015
year=1999
year=1993
but I am only interested in finding which columns the table is partitioned on, in this case, year. And I would like to be able to do this of multiple tables at once, giving me a list of their names and partitioned columns somewhat like this.
table_name partition_col
table_1 year
table_2 year, month
I tried the solutions here...
SELECT * FROM table_db."table_1$partitions"
does give me results with one column for each partition...
# year
1 2007
2 2015
3 1999
4 1993
...but I couldn't extract the column names from this query.