Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16353 )

Change subject: IMPALA-10096: Use the ordinal if the group by ordinal reference 
is still a numeric literal
......................................................................


Patch Set 1: Code-Review+1

(3 comments)

Nice find! I'll reach to Aman to see if he can have a look as well.

http://gerrit.cloudera.org:8080/#/c/16353/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/16353/1//COMMIT_MSG@14
PS1, Line 14: count(1)
I think we should mention that this happens when we need to re-analyze the 
rewritten statement. For example, here "count(1)" is rewritten to "count(*)" so 
we need to re-analyze the new query. If the original query uses "count(*)", it 
won't hit the bug since there are no rewriting happens.


http://gerrit.cloudera.org:8080/#/c/16353/1/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/16353/1/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java@759
PS1, Line 759: // use the ordinal if the ordinal reference is still a numeric 
literal
Maybe this is clearer: "use the original ordinal if the analyzed expr is a 
constant int"


http://gerrit.cloudera.org:8080/#/c/16353/1/testdata/workloads/functional-planner/queries/PlannerTest/aggregation.test
File testdata/workloads/functional-planner/queries/PlannerTest/aggregation.test:

http://gerrit.cloudera.org:8080/#/c/16353/1/testdata/workloads/functional-planner/queries/PlannerTest/aggregation.test@1628
PS1, Line 1628: ====
Could you add more tests like:
select -1, id, count(1) from functional.dimtbl group by 1, 2;
select 2, id, count(1) from functional.dimtbl group by 1, 2;
select 2, id, count(1) from functional.dimtbl group by 1;



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I34f659d15073d69aa0a4685f56ad94557df86560
Gerrit-Change-Number: 16353
Gerrit-PatchSet: 1
Gerrit-Owner: Xianqing He <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Comment-Date: Thu, 03 Sep 2020 07:56:08 +0000
Gerrit-HasComments: Yes

Reply via email to