Skip to content
Advertisement

Why I am getting error while performing group by in hive?

I am executing below command in hive:

Error: Error while compiling statement: FAILED: SemanticException [Error 10025]: Line 1:7 Expression not in GROUP BY key ‘data_volume_gprs_dl’ (state=42000,code=10025)

Why I am getting this error?

Advertisement

Answer

All non-aggregated columns should be in the GROUP BY list such as

If you need to group by parent.file_name and parent.record_number columns only, then you can apply aggregation ( sum(), avg(), count() ) functions for the rest of the columns. Even addition sum(child.data_volume_gprs_dl + child.data_volume_gprs_ul) might be possible.

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