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

前端 未结 6 1459
遇见更好的自我
遇见更好的自我 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:34

    It is a good question. the count() will take much time for finding the result. But unfortunately, count() is the only way to do.

    There is an alternative way(can't say alternate but better latency than above case) :

    Set the property

    set hive.exec.mode.local.auto=true;

    and run the same command ( select count(*) from tbl ) which gives better latency than prior.

提交回复
热议问题