问题描述:

When i am using more aggregate function or more case statements in hive query --> getting error : IndexOutOfBoundsException Index .

can someone help me to resolve this issue.

Thanks,

网友答案:

I got the answer,

Issue:

A query having same aggregate functions but in different case .

e.g. SELECT key, COUNT(value) FROM src_table GROUP BY key HAVING count(value) >= 4)  does not work and throws IndexOutOfBoundsException.

Reason:

The cause is that Hive treats count(value) and COUNT(value) in this query as two different aggregate expression when compiling query and generating plan. They are case sensitive.

e.g. SELECT key, COUNT(value) FROM src_table GROUP BY key HAVING COUNT(value) >= 4)  Works perfectly

Thanks,

相关阅读:
Top