Skip to content
Advertisement

How to know location about partition in hive?

If I write a hive sql like

ALTER TABLE tbl_name ADD PARTITION (dt=20131023) LOCATION 'hdfs://path/to/tbl_name/dt=20131023;

How can I query this location about partition later? Because I found there is some data in location but I can’t query them, hive sql like

SELECT data FROM tbl_name where dt=20131023;

Advertisement

Answer

show table extended like 'tbl_name' partition (dt='20131023');

Show Tables/Partitions Extended

SHOW TABLE EXTENDED will list information for all tables matching the given regular expression. Users cannot use regular expression for table name if a partition specification is present. This command’s output includes basic table information and file system information like totalNumberFiles, totalFileSize, maxFileSize, minFileSize, lastAccessTime, and lastUpdateTime. If partition is present, it will output the given partition’s file system information instead of table’s file system information.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement