How to find the most recent partition in HIVE table

后端 未结 4 1106
清酒与你
清酒与你 2020-12-31 05:41

I have a partitioned table - with 201 partitions. I need to find latest partition in this table and use it to post process my data. The query to find list of all partitions

4条回答
  •  孤城傲影
    2020-12-31 06:21

    if you know your table location in hdfs. This is the most quick way without even opening the hive shell.

    You can check you table location in hdfs using command;

    show create table 
    

    then

    hdfs dfs -ls | sort -k6,7 | tail -1
    

    It will show latest partition location in hdfs

提交回复
热议问题