Hive query to quickly find table size (number of rows)

前端 未结 6 1458
遇见更好的自我
遇见更好的自我 2021-01-31 09:20

Is there a Hive query to quickly find table size (i.e. number of rows) without launching a time-consuming MapReduce job? (Which is why I want to avoid COUNT(*).)

6条回答
  •  广开言路
    2021-01-31 09:49

    solution, though not quick
    if the table is partitioned, we can count the number of partitions and count(number of rows) in each partition.
    For example:, if partition by date (mm-dd-yyyy)

    select partition_date, count(*) from  where  >= '05-14-2018' group by 
    

提交回复
热议问题