Support Questions
Find answers, ask questions, and share your expertise

get counts of rows meeting different filter criteria from hive

Explorer

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

Accepted Solutions

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

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