Qifan Chen has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16346 )

Change subject: IMPALA-10064: Support constant propagation for eligible range 
predicates
......................................................................


Patch Set 8:

(3 comments)

Thanks for the answers!

http://gerrit.cloudera.org:8080/#/c/16346/8/fe/src/main/java/org/apache/impala/analysis/ConstantPredicateHandler.java
File fe/src/main/java/org/apache/impala/analysis/ConstantPredicateHandler.java:

http://gerrit.cloudera.org:8080/#/c/16346/8/fe/src/main/java/org/apache/impala/analysis/ConstantPredicateHandler.java@78
PS8, Line 78: isRangeOp && !(constant instanceof DateLiteral ||
            :             constant instanceof TimestampLiteral))
> It is kind of tricky to make it extensible in that sense because the logic
I am not aware of other products doing the same :-).

However, it seems a cast in the exact numeric (i.e. from smallint to int), or 
char to varchar, the equivalence can be transferred.


http://gerrit.cloudera.org:8080/#/c/16346/8/fe/src/main/java/org/apache/impala/analysis/ConstantPredicateHandler.java@93
PS8, Line 93:  Propagate equality constant predicates to other conjuncts.  
Propagate
            :    * range constant predicates to conjuncts involving date and 
timestamp
            :    * columns.
> So the join scenario is handled differently.  The planner has the notion of
Thanks for the background info. Appreciate it. The Trafodion has similar 
concept (called it VEG: value equivalent group), which is a set for all values 
connecting by equal relationship.

The new logic applies to a local join which is nice. On paper,  I would guess 
the range can be applied to other side of an equi-join as well, similar to the 
min/max optimization for HJ.


http://gerrit.cloudera.org:8080/#/c/16346/8/testdata/workloads/functional-planner/queries/PlannerTest/constant-propagation.test
File 
testdata/workloads/functional-planner/queries/PlannerTest/constant-propagation.test:

http://gerrit.cloudera.org:8080/#/c/16346/8/testdata/workloads/functional-planner/queries/PlannerTest/constant-propagation.test@410
PS8, Line 410: select * from functional_parquet.alltypes_date_partition
             : where date_col = cast(timestamp_col as date)
             : and timestamp_col between '2009-12-01' and '2010-12-01';
> Actually were were never supporting constant propagation where the source i
OK.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I811a1f8d605c27c7704d7fc759a91510c6db3c2b
Gerrit-Change-Number: 16346
Gerrit-PatchSet: 8
Gerrit-Owner: Aman Sinha <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Qifan Chen <[email protected]>
Gerrit-Reviewer: Shant Hovsepian <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Comment-Date: Fri, 28 Aug 2020 18:33:21 +0000
Gerrit-HasComments: Yes

Reply via email to