wangsheng 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 26:

(2 comments)

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

http://gerrit.cloudera.org:8080/#/c/18023/23/fe/src/main/java/org/apache/impala/analysis/Expr.java@1068
PS23, Line 1068:       // and conjunct evaluation.  This is not optimal for 
jitted exprs because it
> THis is a generic function to collect conjuncts. The definition should not
I extract a method 'allowConjunctsFromChild' here.

We add a check for selectivity hint here is due to CompoundPredicate. If we 
don't check here, selectivity hint for AND CompoundPredicate will always 
missing, since conjuncts will be it's children, instead of itself.


http://gerrit.cloudera.org:8080/#/c/18023/23/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/23/fe/src/main/java/org/apache/impala/rewrite/BetweenToCompoundRule.java@70
PS23, Line 70:     result.setSelectivityHint(bp.getSelectivity());
> What if the compound predicate is not a between predicate? Checks here seem
In my opinion, this rule is only used to transform BetweenPredicate to 
CompoundPredicate, so the input predicate must be BetweenPredicate. If current 
predicate is not BetweenPredicate, this rule will return directly in line 41.
So I think set new created CompoundPredicate's selectivity hint value from 
BetweenPredicate seems reasonable.

I don't understand 'What if the compound predicate is not a between predicate', 
can you explain this in more detail?



--
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: 26
Gerrit-Owner: wangsheng <[email protected]>
Gerrit-Reviewer: Amogh Margoor <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Kurt Deschler <[email protected]>
Gerrit-Reviewer: Qifan Chen <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Xiang Yang <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: wangsheng <[email protected]>
Gerrit-Comment-Date: Fri, 31 Mar 2023 07:49:01 +0000
Gerrit-HasComments: Yes

Reply via email to