Surya Hebbar has uploaded a new patch set (#3). ( 
http://gerrit.cloudera.org:8080/23855 )

Change subject: IMPALA-14563: Throw AnalysisException when aggregating complex 
type
......................................................................

IMPALA-14563: Throw AnalysisException when aggregating complex type

Before this change, when the user tries to aggregate by a complex type,
we threw an IllegalStateException.

  SELECT complex_col, count(*) FROM table_example GROUP BY complex_col;

Error:

  java.lang.IllegalStateException: null

This does not provide appropriate context about the query's problem.

Instead of throwing an IllegalStateException, we now throw the
appropriate AnalysisException, which highlights the issue with the query.

  AnalysisException: GROUP BY expression cannot be 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, 16 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/55/23855/3
--
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: 3
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]>
Gerrit-Reviewer: Surya Hebbar <[email protected]>

Reply via email to