Skip to content
Advertisement

hive get percentages of count column not working

i have the following query in hive to get the counts per each of those columns (cluster, country and airline) as a percentage. But my percentage column contains only 0’s.. why/what am i doing wrong below?

Advertisement

Answer

First, you should use window functions.

Second, beware of integer division.

I would phrase this as:

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