apache / apache/datafusion

[EPIC] expression pushdown and file level expression handling

Open
#16,528 1 comment 0 reactions 0 assignees View on GitHub
PROPOSAL EPIC
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

Several feature requests / issues have come up that I think can all be addressed with the groundwork being laid in https://github.com/apache/datafusion/pull/16461:
- https://github.com/apache/datafusion/pull/15261
- https://github.com/apache/datafusion/pull/15057
- https://github.com/apache/datafusion/issues/16004
- https://github.com/apache/datafusion/issues/14993

In particular, https://github.com/apache/datafusion/pull/16461 introduces a general framework for adapting an expression to a file's schema, handling any necessary casts and missing columns.
We can expand this by:

- Optimizing the expressions to minimize cost of casts, wip in https://github.com/pydantic/datafusion/pull/31. Closes https://github.com/apache/datafusion/issues/16004.
- Other optimizations passes, such as evaluating literals / nulls. Also related to https://github.com/apache/datafusion/issues/16004.
- Hook to handle missing columns (e.g. do something other than fill in with nulls based on Field metadata, could be a user defined default value); closes https://github.com/apache/datafusion/pull/15261
- Hook to transform an expression before or after it is rewritten for the physical file schema; closes https://github.com/apache/datafusion/pull/15057.
- Optimization to eliminate casts altogether when two types share the same parquet physical type (change the schema the data is read with and remove the cast).

Contributor guide

Open the contributing guide

Research direction

Start by reading PR 16461, which establishes the expression-to-file-schema adaptation framework, then review the linked pull requests and issues for the desired scope. Choose one explicitly scoped optimization or hook from the list; done means its behavior is implemented and validated against the relevant linked case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.