当前位置: 动力学知识库 > 问答 > 编程问答 >

hadoop - IndexOutOfBoundsException Index in hive

问题描述:

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,

分享给朋友:
您可能感兴趣的文章:
随机阅读: