Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> HIVE-2915: Partitioned Tables in Hive Metastore


Copy link to this message
-
HIVE-2915: Partitioned Tables in Hive Metastore
Hi,

I'm currently using CDH3u3 and Hive 0.7.1, and I'm looking into how the
metadata is stored for partitioned tables within the RDBMS.

The issue that I see is that for tables with multiple partitioning columns,
there's no good way to determine which PARTITION_KEY_VALS record maps to
it's logical PARTITION_KEYS record.  I'd like to avoid trying to parsing
the PARTITIONS.PART_NAME field, as I'm unaware of anything like LATERAL
VIEW(EXPLODE()) in MySQL.
Sample metastore query:
SELECT
  DBS.NAME,
  TBLS.TBL_NAME,
  TBLS.OWNER,
  PARTITION_KEYS.PKEY_NAME,
  PARTITIONS.PART_ID,
  PARTITIONS.PART_NAME,
  PARTITION_KEY_VALS.PART_KEY_VAL
FROM DBS
  INNER JOIN TBLS ON
    DBS.DB_ID = TBLS.DB_ID
  INNER JOIN PARTITION_KEYS ON
    TBLS.TBL_ID = PARTITION_KEYS.TBL_ID
  INNER JOIN PARTITIONS ON
    TBLS.TBL_ID = PARTITIONS.TBL_ID
  INNER JOIN PARTITION_KEY_VALS ON
    PARTITIONS.PART_ID = PARTITION_KEY_VALS.PART_ID
ORDER BY DBS.NAME, TBLS.TBL_NAME, PARTITIONS.PART_NAME;

Thanks

Matt