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!

get counts of rows meeting different filter criteria from hive

avatar
Rising Star

What is the most efficient way to get count of records meeting different search criteria from a Hive table.

1. count all records where column-a = Null

2. count all records where column-b in [1, 3, 5]

3. count all records where column-c = 'xxx'

etc.

there are a couple hundred of these counts, in groups of 3 or 4.

 

 

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@ChineduLB What is your exact Query? You can write count Queries SQL for Hive table. 

 

In general you can refer below articles: 

 

https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.0/performance-tuning/content/hive_prepare_to_tun...

 

https://www.qubole.com/blog/5-tips-for-efficient-hive-queries/

 

Thanks,
Tamil Selvan K

View solution in original post

1 REPLY 1

avatar
Expert Contributor

@ChineduLB What is your exact Query? You can write count Queries SQL for Hive table. 

 

In general you can refer below articles: 

 

https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.0/performance-tuning/content/hive_prepare_to_tun...

 

https://www.qubole.com/blog/5-tips-for-efficient-hive-queries/

 

Thanks,
Tamil Selvan K