Marco99
Marco99

Reputation: 1659

Hive external table - Not giving correct count after replacing the underlying data file with a new file containing different number of records

It is noticed that count(*) does not give the updated count, after replacing the already existing data file, with a new file containing different number of records, in the HDFS location of the external table.

Is there a way to refresh this value? Or, will it get automatically refreshed after a configurable time duration?

Upvotes: 1

Views: 3098

Answers (1)

Zoltan
Zoltan

Reputation: 3115

Hive maintains a cache of some table statistics including the number of rows. Try executing ANALYZE TABLE tablename COMPUTE STATISTICS to update these cached stats and run the query again. See Statistics in Hive for details.

Upvotes: 4

Related Questions