impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoram Thanga (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4682 Fix IllegalStateException thrown by aggregate function.
Date Thu, 05 Oct 2017 18:32:13 GMT
Hello Michael Ho, Dimitris Tsirogiannis, anujphadke, Alex Behm, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/8143

to look at the new patch set (#3).

Change subject: IMPALA-4682 Fix IllegalStateException thrown by aggregate function.
......................................................................

IMPALA-4682 Fix IllegalStateException thrown by aggregate function.

When one runs a query like

'select * from t order by count(a)'

we are incorrectly throwing an IllegalStateException. This is an
invalid query, and we are correctly handling it if "*" is replaced
by a specific column:

'select a from t order by count(b)'

which produces the error message

"ERROR: AnalysisException: select list expression not produced by
aggregation output (missing from GROUP BY clause?): a"

This patch fixes the handling of '*' in this context, so that the
error becomes

"ERROR: AnalysisException: select list expression not produced by
aggregation output (missing from GROUP BY clause?): *"

Note that the second changed line is required because
selectListItem.Expr_ is null when SelectListItem.isStar_ is true.

A new FE unit test has been added for this use case.

Change-Id: I57c20aeed401275d45913fedfd61c206c38641b7
---
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, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/43/8143/3
-- 
To view, visit http://gerrit.cloudera.org:8080/8143
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I57c20aeed401275d45913fedfd61c206c38641b7
Gerrit-Change-Number: 8143
Gerrit-PatchSet: 3
Gerrit-Owner: Zoram Thanga <zoram@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Gerrit-Reviewer: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Zoram Thanga <zoram@cloudera.com>
Gerrit-Reviewer: anujphadke <aphadke@cloudera.com>

Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message