Skip to content

Skip unused struct fields in DataFusion projection fallback - #11642

Draft
connortsui20 wants to merge 1 commit into
developfrom
ct/datafusion-partial-field-projection
Draft

connortsui20 wants to merge 1 commit into
developfrom
ct/datafusion-partial-field-projection

Conversation

@connortsui20

@connortsui20 connortsui20 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

On develop, when a projection falls back to DataFusion, the scan reads whole input columns. This PR lets the scan read only the referenced leaves of non-nullable structs while DataFusion evaluates the original projection over those leaves.

CASE WHEN id = 2 THEN CAST(CAST(s['inner']['label'] AS INT) AS VARCHAR)
     ELSE UPPER(s['inner']['label'])
END

The scan reads s.inner.label with its Arrow field name and metadata. DataFusion still decides which rows reach the cast, so a label of 'x' on a row with id = 1 is safe.

Related to #11432, which runs mixed expressions inside Vortex scans. Its callback currently reads the parent struct for field access in this example.

This change was implemented and reviewed with OpenAI Codex.

A single unsupported projection makes the scan read whole struct inputs. Supply provably equivalent field reads from the scan so DataFusion can finish the enclosing expressions without reading unused siblings. Custom converters retain control of the projection split.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20 connortsui20 added the changelog/performance A performance improvement label Nov 19, 2026 — with ChatGPT Codex Connector
@connortsui20 connortsui20 self-assigned this Nov 19, 2026
@connortsui20 connortsui20 changed the title Push struct field reads through DataFusion projection fallback Skip unused struct fields in DataFusion projection fallback Nov 19, 2026
connortsui20 added a commit that referenced this pull request Nov 20, 2026
The branch carried the prototype versions of the changes that the open
PRs make, and those PRs have moved on in review. For example, #11640
now names the layout `vortex.extension`. This merge takes the tree of a
stack on develop at 967bcb6, which holds the PR heads and ports of
the two changes that have no PR yet:

- #11640 at 24fd9da.
- #11710 at add4115.
- #11639 at 4f25e2f. Its newer head, 115318b, fails three of its
  own tests.
- #11642 at d16038c.
- Zone maps of bounds beneath nullable structs.
- Single fields of list elements on both scans.

A merge instead of a force-push keeps every commit that the branch
published reachable.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant