- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to find the count of NULL values in Hive
- Labels:
-
Apache Hadoop
-
Apache Hive
Created ‎01-06-2019 10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎01-06-2019 02:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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";
Created ‎01-06-2019 02:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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";
Created ‎01-08-2019 03:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Shu . Thankyou so much . Second query worked
