Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

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

New Contributor

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");