datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

extract or clause as predicate for join rels

Open HuSen8891 opened this issue 3 years ago • 0 comments

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

examine OR clause for join to see if any useful clauses can be extracted and push down. the new clause as join rel's predicate will filter more rows before join.

for such query: select * from test, test1 where (test.a = test1.c and test.b > 1) or (test.b = test1.d and test.c < 10);

current logical plan: Filter: (a = c and b > 1) or (b = d and c < 10) crossjoin: TableScan: projection=[a, b, c] TableScan: projection=[c, d]

optimized to

Filter: (a = c and b > 1) or (b = d and c < 10) crossjoin: Filter: (b > 1) or (c < 10) TableScan: projection=[a, b, c] TableScan: projection=[c, d]

Describe the solution you'd like Above

Describe alternatives you've considered None

Additional context None

HuSen8891 avatar Sep 21 '22 18:09 HuSen8891