You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Chaoyu Tang <ct...@gmail.com> on 2014/08/06 21:04:17 UTC

Review Request 24404: HIVE-7635: Query having same aggregate functions but different case throws IndexOutOfBoundsException

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24404/
-----------------------------------------------------------

Review request for hive.


Bugs: HIVE-7635
    https://issues.apache.org/jira/browse/HIVE-7635


Repository: hive-git


Description
-------

A query having same aggregate functions but in different case (e.g. SELECT key, COUNT(value) FROM src 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.


Diffs
-----

  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 51838ae 
  ql/src/test/queries/clientpositive/having.q 5b1aa69 
  ql/src/test/results/clientpositive/having.q.out d912001 

Diff: https://reviews.apache.org/r/24404/diff/


Testing
-------

1. The fix addressed the failed query with different case in aggregate function name in the query
2. New unit tests passed
3. patch will be submitted for pre-commit tests


Thanks,

Chaoyu Tang


Re: Review Request 24404: HIVE-7635: Query having same aggregate functions but different case throws IndexOutOfBoundsException

Posted by Chaoyu Tang <ct...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24404/
-----------------------------------------------------------

(Updated Aug. 7, 2014, 3:40 p.m.)


Review request for hive.


Changes
-------

Fixed the failed test due to the missing update to having.q.out for Tez. Recreated the diff and uploaded here. Thanks for the review.


Bugs: HIVE-7635
    https://issues.apache.org/jira/browse/HIVE-7635


Repository: hive-git


Description
-------

A query having same aggregate functions but in different case (e.g. SELECT key, COUNT(value) FROM src 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.


Diffs (updated)
-----

  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 51838ae 
  ql/src/test/queries/clientpositive/having.q 5b1aa69 
  ql/src/test/results/clientpositive/having.q.out d912001 
  ql/src/test/results/clientpositive/tez/having.q.out e96342d 

Diff: https://reviews.apache.org/r/24404/diff/


Testing
-------

1. The fix addressed the failed query with different case in aggregate function name in the query
2. New unit tests passed
3. patch will be submitted for pre-commit tests


Thanks,

Chaoyu Tang