wei lin created CALCITE-1942:
--------------------------------
Summary: predicate pushingdown will not require toCNF
Key: CALCITE-1942
URL: https://issues.apache.org/jira/browse/CALCITE-1942
Project: Calcite
Issue Type: Improvement
Reporter: wei lin
Assignee: Julian Hyde
Currently, if the expression is complicated, toCNF will run out of calling
stack size and make the optimizer run out of time.
we propose a new approach to do the predicate pushing down.
When we consider the predicate pushing down to child, if there are some
expressions contain some columns which are not belong to this child output
schema (they comes from other children), then we treat as anyRexNode.
Then we use the following way to extract interesting predicate for pushing down
/*
Decompose expressions into [InterestedPred, Rest] pair based on given
RexChecker.
anyRexNode or rexNode = anyRexNode
anyRexNode and rexNode = rexNode
not(anyRexNode) = anyRexNode.
*/
for example, (A.a > 10 or B.a > 10) and (A.b > 4 or A.b < 2), we will extract
the interesting prediate (A.b > 4 or A.b <2).
(A.a > 10 or B.a > 10) and (A.b > 4 or A.b < 2)
=> (A.a > 10 or anyRexNode) and (A.b > 4 or A.b < 2)
=> anyRexNode and (A.b > 4 or A.b < 2)
=> (A.b > 4 or A.b < 2)
Alibaba MaxCompute Optimizer Team
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)