I have created a table in HIVE
CREATE TABLE IF NOT EXISTS daily_firstseen_analysis (
firstSeen STRING,
category STRING,
circle
if you have an external table, remove all the files in HDFS, and insert into the table again then select count(*) will be incorrect.
I execute ANALYZE TABLE ...
at first is OK, but raise error when i try again.so i try:
hive> REFRESH TABLE daily_firstseen_analysis;
hive> SELECT COUNT(*) FROM daily_firstseen_analysis;
this is explain
I had the same problem, and using ANALYZE fixed it. Running these commands in order should give you the correct count:
hive> ANALYZE TABLE daily_firstseen_analysis PARTITION(day) COMPUTE STATISTICS;
hive> SELECT COUNT(*) FROM daily_firstseen_analysis;
i.e. you have to use the analyze command before the count. You have half the answer within your question.