Skip to content

introduce StatisticsConverter::from_column_index#9540

Open
friendlymatthew wants to merge 1 commit intoapache:mainfrom
pydantic:friendlymatthew/statistics-converter-from-col-index
Open

introduce StatisticsConverter::from_column_index#9540
friendlymatthew wants to merge 1 commit intoapache:mainfrom
pydantic:friendlymatthew/statistics-converter-from-col-index

Conversation

@friendlymatthew
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

This PR adds a constructor StatisticsConverter::from_column_index that bypasses schema resolution and accepts a pre-resolved leaf column index directly

Datafusion's pruning predicate system needs stats for struct fields to support predicate pushdown on expressions like WHERE my_struct.field > 67. Datafusion already resolves struct fields to Parquet leaf indices elsewhere, but has no way to pass that index to StatisticsConverter

@github-actions github-actions bot added the parquet Changes to the parquet crate label Mar 11, 2026
@friendlymatthew
Copy link
Contributor Author

Related to apache/datafusion#20871

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @friendlymatthew -- sorry for the delayed review

})
}

/// Create a new `StatisticsConverter` from a Parquet leaf column index directly.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @friendlymatthew -- this makes sense to me.

However, I think we need at least some basic tests showing this working (aka create a Parquet file with a struct column and then read the statistics out of it using this API)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. You may also like this! apache/datafusion#21003 (comment)

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

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StatisticsConverter does not support nested fields (e.g. struct fields)

2 participants