Skip to content
Advertisement

how to include 0 results in count with group by in HIVEQL

I’m a newbie in HIVE. I want to include 0 rows in results

I have one table like

this is my query

example result is

but my desired result is

How can I get a 0 in results?

Advertisement

Answer

You can do this but you need to remove where clause.

You can also do using self join.

EDIT – I changed below SQL as per your need. If you have partitions on part hour and data_source_id, your SQL should be quick.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement