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.
I got the answer,
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.
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