0
votes

Show Partitions --> In Hive/Spark, this command only provides the Partition, without providing the location information on hdfs/s3

Since we maintain different location for each partition in a table, is there a way to retrieve the location information along using Hive/Spark without querying the Metastore tables?

2

2 Answers

1
votes

DESCRIBE FORMATTED <db>.table will return will give you the location, among a lot of other data. There will be a line in the output that starts with LOCATION.

1
votes

You can use the query: show table extended like 'your_table_name' partition (partition_name);

This provides a more concise information and also in a format that is easy to pass if you want to extract information using a shell script.