Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to find the count of NULL values in Hive

avatar
New Member

Query:

select 2gusage,count(2gusage) from demo group by 2gusage;

Output:

MID 765153

HIGH 18095461

LOW 119069472

NULL 25997075

I tried the below query to find the count of NULL values

Query

select count(*) from demo where 2gusage is 'NULL';

Output

0

Kindly help me out with the query to find the count of NULL values

1 ACCEPTED SOLUTION

avatar
Master Guru
@Basil Paul

1.Try with below query:

select count(*) from demo where 2gusage is NULL;

2.If literal NULL is in your data for 2gusage column then use the below query:

select count(*) from demo where 2gusage = "NULL";

View solution in original post

2 REPLIES 2

avatar
Master Guru
@Basil Paul

1.Try with below query:

select count(*) from demo where 2gusage is NULL;

2.If literal NULL is in your data for 2gusage column then use the below query:

select count(*) from demo where 2gusage = "NULL";

avatar
New Member

@Shu . Thankyou so much . Second query worked