Kurt Deschler 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 23:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG@11
PS23, Line 11: Hence, we add new hints to reduce such errors. Maybe in the 
future,
No need to mention histograms here. Instead just say this is giving a qay to 
override estimates.


http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG@14
PS23, Line 14: another
Don't say another unless you want to qualify that means


http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG@15
PS23, Line 15: hint to original selectivity computing.
Describe the syntax additions here at a high level. i.e. The parser will 
interpret expressions wrapped in () followed by a C-style /* comment */ as a 
predicate hint. The predicate hint currently supports +SELECTIVITY(f) where 'f' 
is a positive floating point number to use as the selectivity for the preceding 
expression.


http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG@17
PS23, Line 17: Format like this:
Single predicate example:


http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG@21
PS23, Line 21: Besides, this hint is also valid for compound predicate like 
this:
Compound Predicate Example:


http://gerrit.cloudera.org:8080/#/c/18023/23//COMMIT_MSG@25
PS23, Line 25: But pay attention, if we want to use 'SELECTIVITY' hint for 
predicate,
State this first when you are describing the general syntax.


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:         && !((CompoundPredicate) 
this).selectivityValidHintSet()) {
Skipping child conjuncts here based on a hint does not seem legal


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());
Probably better to no propagate the selectivity. If user want it to apply 
across predicates, they should be able to wrap them in a () block.



--
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: 23
Gerrit-Owner: wangsheng <sky...@163.com>
Gerrit-Reviewer: Amogh Margoor <amarg...@gmail.com>
Gerrit-Reviewer: Fucun Chu <chufu...@hotmail.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kdesc...@cloudera.com>
Gerrit-Reviewer: Qifan Chen <qfc...@hotmail.com>
Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>
Gerrit-Reviewer: Yifan Zhang <chinazhangyi...@163.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com>
Gerrit-Reviewer: wangsheng <sky...@163.com>
Gerrit-Comment-Date: Fri, 24 Mar 2023 19:57:45 +0000
Gerrit-HasComments: Yes

Reply via email to