Alex Behm has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/8801 )

Change subject: IMPALA-5191: Standardize column alias behavior
......................................................................


Patch Set 11:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/8801/11/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java
File fe/src/main/java/org/apache/impala/analysis/SelectStmt.java:

http://gerrit.cloudera.org:8080/#/c/8801/11/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java@891
PS11, Line 891:    * If the rewritten expr is a NumericLiteral, then return the 
original expr, otherwise
If given expr is rewritten into an integer literal ...


http://gerrit.cloudera.org:8080/#/c/8801/11/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java@896
PS11, Line 896:   private Expr rewriteIfResultIsNotNumericLiteral(ExprRewriter 
rewriter, Expr expr)
rewriteCheckOrdinalResult()


http://gerrit.cloudera.org:8080/#/c/8801/11/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java@899
PS11, Line 899:     if (rewrittenExpr instanceof NumericLiteral) return expr;
we use {} for multi-line if else

check should be:

if (rewrittenExpr.isLiteral() && rewrittenExpr.getType().isIntegerType()) 
return expr;


http://gerrit.cloudera.org:8080/#/c/8801/11/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java
File fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java:

http://gerrit.cloudera.org:8080/#/c/8801/11/fe/src/test/java/org/apache/impala/analysis/AnalyzeStmtsTest.java@1055
PS11, Line 1055:         "group by one, substring(cast(two as string), 1, 1), 
three");
Add tests for the constant-folding changes, e.g.:

Should work:
select int_col, count(*) from functional.alltypes group by 1 + 1 order by 1 + 4

not sure how to test HAVING, you can think about it



--
To view, visit http://gerrit.cloudera.org:8080/8801
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0f82483b486acf6953876cfa672b0d034f3709a8
Gerrit-Change-Number: 8801
Gerrit-PatchSet: 11
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Taras Bobrovytsky <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Tue, 16 Jan 2018 23:08:52 +0000
Gerrit-HasComments: Yes

Reply via email to