Skip to content

fix: avoid full scan for metadata-only projections with _pos - #2995

Open
anoopj wants to merge 1 commit into
apache:mainfrom
anoopj:metadata-only-projection
Open

fix: avoid full scan for metadata-only projections with _pos#2995
anoopj wants to merge 1 commit into
apache:mainfrom
anoopj:metadata-only-projection

Conversation

@anoopj

@anoopj anoopj commented Aug 14, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

What changes are included in this PR?

A projection of only metadata columns leaves the data field-id list empty, which get_arrow_projection_mask maps to reading all columns (so a bare COUNT(*) still gets a row count). When _pos is projected, the RowNumber virtual column supplies the row count independently of the data columns, so read no data columns instead of all of them. Pure-constant and empty projections keep the read-all behavior, since they have no other row source.

Are these changes tested?

Added several tests

A projection of only metadata columns leaves the data field-id list empty,
which get_arrow_projection_mask maps to reading all columns (so a bare
COUNT(*) still gets a row count). When _pos is projected, the RowNumber
virtual column supplies the row count independently of the data columns, so
read no data columns instead of all of them. Pure-constant and empty
projections keep the read-all behavior, since they have no other row source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant