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

Change subject: IMPALA-7942: Add query hints for cardinalities and selectivities
......................................................................


Patch Set 8:

> "Besides, we can not modify like this directly yet:
 > | predicate:p selectivity_hint:h
 > {:
 > if (hint != null) {
 > p.setSelectivityHint(Double.valueOf(hint.getArgs().get(0)));
 > }
 > RESULT = p;
 > :}
 > Since 'predicate' is an 'Expr', instead of 'Predicate'.
 > 'setSelectivityHint' method is belong to 'Predicate'. Here is
 > import statement:
 > nonterminal Expr predicate, bool_test_expr;"
 > 
 > I think we should verify p to be a Predicate first.
 >
 > If there exists a hint {
 > If (p instanceof Predicate) {  
 > ((Predicate)p).setSelectivityHint(Double.valueOf(hint.getArgs().get(0)));
 > } else {
 > // throw an error
 > }
 > }

Maybe I can trytrywang this. Here is another question I want to discuss with 
you. If we support set selectivity hint for compound predicate.

For 'a=1 /* +SELECTIVITY(0.1) */', this selectivity is definately belong to 
'a=1'
For 'a=1 and (b=2 /* +SELECTIVITY(0.1) */)', this selectivity is definately 
belong to 'b=2'
For '(a=1 and b=2) /* +SELECTIVITY(0.1) */', this selectivity is definately 
belong to 'a=1 and b=2'

But for these cases:
1. For 'a=1 and b=2 /* +SELECTIVITY(0.1) */'
2. For '(a=1 and b=2 /* +SELECTIVITY(0.1) */)'
3. For '(a=1) and (b=2) /* +SELECTIVITY(0.1) */
Selectivity should belong to which predicate? 'b=2' or 'a=1 and b=2'?


--
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: 8
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: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: wangsheng <[email protected]>
Gerrit-Comment-Date: Fri, 25 Mar 2022 13:16:28 +0000
Gerrit-HasComments: No

Reply via email to