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

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

    tblproperties will give the size of the table and can be used to grab just that value if needed.

    -- gives all properties
    show tblproperties yourTableName
    
    -- show just the raw data size
    show tblproperties yourTableName("rawDataSize")
    

提交回复
热议问题