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.

Select * from and & Select count (*) different result

Highlighted

Select * from and & Select count (*) different result

New Contributor

Hi Team,

Iam getting different result while executing below command

select count (*) --output 816293

&

Select * from --output 809,254 rows ( which is correct)

Also tried by using " analyze table TABLE_NAME partition(partition_date) compute statistics ; " and even done with running "MSCK REPAIR TABLE <tablename>;" But no use. Is their anything that I am missing.

Kindly Need help at this point .

1 REPLY 1

Re: Select * from and & Select count (*) different result

New Contributor

Try set hive.compute.query.using.stats=false and see if you get correct count using select count(*). If this works that means you have stale statistics and you need to re-run analyze table on all partitions.

Don't have an account?
Coming from Hortonworks? Activate your account here