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

Change subject: IMPALA-7942 (part 2): Add query hints for predicate 
selectivities
......................................................................


Patch Set 21:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/18023/19/fe/src/main/java/org/apache/impala/analysis/Predicate.java
File fe/src/main/java/org/apache/impala/analysis/Predicate.java:

http://gerrit.cloudera.org:8080/#/c/18023/19/fe/src/main/java/org/apache/impala/analysis/Predicate.java@69
PS19, Line 69:
> I think selectivity hint is valid for Predicate, instead of Expr, so I impl
I see. This makes sense to me. Thanks for the explanation!


http://gerrit.cloudera.org:8080/#/c/18023/21/fe/src/main/java/org/apache/impala/analysis/Predicate.java
File fe/src/main/java/org/apache/impala/analysis/Predicate.java:

http://gerrit.cloudera.org:8080/#/c/18023/21/fe/src/main/java/org/apache/impala/analysis/Predicate.java@171
PS21, Line 171:     this.selectivityHint_ = selectivityHint;
Should we update hasValidSelectivityHint_ as well? Or is it enough to only set 
hasValidSelectivityHint_ in constructors and analyzeSelectivityHint()?


http://gerrit.cloudera.org:8080/#/c/18023/21/fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java
File fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java:

http://gerrit.cloudera.org:8080/#/c/18023/21/fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java@68
PS21, Line 68:     result.setSelectivityHint(bp.getSelectivity());
Could you add a comment for why we always set the selectivity hint regradless 
whether the selectivity of 'bp' comes from hints? Maybe this is always better 
than what the planner will estimate?


http://gerrit.cloudera.org:8080/#/c/18023/21/testdata/workloads/functional-planner/queries/PlannerTest/predicate-selectivity-hint.test
File 
testdata/workloads/functional-planner/queries/PlannerTest/predicate-selectivity-hint.test:

http://gerrit.cloudera.org:8080/#/c/18023/21/testdata/workloads/functional-planner/queries/PlannerTest/predicate-selectivity-hint.test@130
PS21, Line 130: where (l_shipdate BETWEEN '1998-09-01' AND '1998-09-03')/* 
+SELECTIVITY(0.5)*/
missing the SELECT part here, which causes the test failure



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2776b9bbd878b8a21d9c866b400140a454f59e1b
Gerrit-Change-Number: 18023
Gerrit-PatchSet: 21
Gerrit-Owner: wangsheng <[email protected]>
Gerrit-Reviewer: Amogh Margoor <[email protected]>
Gerrit-Reviewer: Fucun Chu <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Qifan Chen <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Yifan Zhang <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: wangsheng <[email protected]>
Gerrit-Comment-Date: Thu, 23 Mar 2023 00:49:20 +0000
Gerrit-HasComments: Yes

Reply via email to