Skip to content

Field pruning in nested struct scan#7327

Closed
brancz wants to merge 2 commits into
vortex-data:developfrom
polarsignals:prune-scan
Closed

Field pruning in nested struct scan#7327
brancz wants to merge 2 commits into
vortex-data:developfrom
polarsignals:prune-scan

Conversation

@brancz

@brancz brancz commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

I'm trying to have scans read only a subset of a nested struct. It's of the shape: List<Struct<a: Utf8, b: Int64>, so I can't use regular projections in DataFusion, since those only support indices. This is my best attempt, combined with an optimizer rule that modifies the table schema to the subset under certain circumstances.

Testing

Added a unit test that fails without the second commit.

Notes

Happy to think through other approaches to this, this was just the first thing that I came up with.

Comment on lines +63 to +67
let can_fast_path = match target_fields {
None => true,
Some(fields) => fields.len() >= n_struct_fields,
};
if can_fast_path {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use is_none_or here

@connortsui20 connortsui20 added changelog/performance A performance improvement action/benchmark Trigger full benchmarks to run on this PR labels Apr 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days

@github-actions github-actions Bot added the stale This PR is stale and will be auto-closed soon label May 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions Bot closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action/benchmark Trigger full benchmarks to run on this PR changelog/performance A performance improvement stale This PR is stale and will be auto-closed soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants