Surya Hebbar has uploaded a new patch set (#2). (
http://gerrit.cloudera.org:8080/23855 )
Change subject: IMPALA-14563: Throw AnalysisException when aggregating complex
type
......................................................................
IMPALA-14563: Throw AnalysisException when aggregating complex type
Currently, when the user tries to aggregate by a complex type column,
we throw an IllegalStateException.
SELECT complex_col, count(*) FROM table_example GROUP BY complex_col;
java.lang.IllegalStateException: null
This does not provide appropriate context about the query's problem.
Instead of throwing an IllegalStateException, we should throw the
appropriate AnalysisException, which highlights the issue with the query.
AnalysisException: GROUP BY expression cannot used on complex types
without specifying a field
This helps the user rewrite the query correctly by making them aware that
specifying a field would fix the query.
SELECT complex_col.val1, count(*) FROM table_example GROUP BY
complex_col.val1;
Testing:
Added tests to TestsGroupBy() method in AnalyzeStmtsTest.java
Change-Id: Ie431873efe7100e8150e93be2aa016381d687268
---
M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
2 files changed, 17 insertions(+), 5 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/55/23855/2
--
To view, visit http://gerrit.cloudera.org:8080/23855
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie431873efe7100e8150e93be2aa016381d687268
Gerrit-Change-Number: 23855
Gerrit-PatchSet: 2
Gerrit-Owner: Surya Hebbar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>