apache / apache/datafusion

Eliminate more outer joins by supporting more expressions

Open
#13,232 5 comments 3 reactions 0 assignees View on GitHub
enhancement optimizer performance
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

This PR by @JasonLi-cn tried to support more pushdown of filters https://github.com/apache/datafusion/pull/13184 , however the implementation wasn't 100% right as it pushed down more predicates, but didn't change the join type (left to inner).

### Describe the solution you'd like

Add support for a wider range of expressions in `EliminateOuterJoin`, notably in `extract_non_nullable_columns`.
We lack support of more complex nested expressions, quite some binary operators, UDFs etc. such as:

* `abs(x) > 1`
* `a + a` > `c + b`

We should aim to support any operator that returns null when the input value is null (most binary / unary operators).

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the EliminateOuterJoin optimizer rule, especially extract_non_nullable_columns, and review PR #13184 for the existing pushdown behavior. Done means supporting the described nested expressions, binary operators, and UDFs that return null for null inputs while changing the join type correctly when predicates allow it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.