Support Questions
Find answers, ask questions, and share your expertise

How Do I get the accurate Hive Table row count value through Hive Metastore API


I access hive tables through the hive metastore api. I'm trying to get the hive table row count via the below lines of code. The problem I get is that some of the values returned are inaccurate. How do I get the updated/accurate table row count value. The numRows property does not seem to update as the hive table updates.

HCatTable tbl; //table object 
Map<String, String> tableProps =tbl.getTblProps(); //table property map object
String value = tableProps.get("numRows");