Skip to content

Conversation

@comphead
Copy link
Contributor

@comphead comphead commented Jun 20, 2025

Which issue does this PR close?

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) datasource Changes to the datasource crate labels Jun 20, 2025
@comphead comphead changed the title Dev WIP: Datafusion to skip non parquet files for parquet reader Jun 20, 2025
@comphead comphead marked this pull request as ready for review June 24, 2025 00:15
@comphead comphead changed the title WIP: Datafusion to skip non parquet files for parquet reader TableProvider to skip files in the folder which non relevant to selected reader Jun 24, 2025
// specifically for parquet file format.
// See: https://github.com/apache/datafusion/issues/7317
None => {
// if the folder then rewrite a file path as 'path/*.parquet'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is an actual fix

Copy link
Contributor

Choose a reason for hiding this comment

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

This will mean a directory of files like foo/my_file.parquet.snappy would not be readable anymore -- I think that spark creates files like my_file.snappy.parquet so it should be ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should be ok, compressed files are usually *.codec.parquet and more broad wildcard *.parquet should read them. My local test I did against part-00000-9b95f137-d11f-44b6-84b7-d49c95bc7c5b-c000.snappy.parquet

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.

This makes sense to me -- thank you @comphead

cc @hendrikmakait

// specifically for parquet file format.
// See: https://github.com/apache/datafusion/issues/7317
None => {
// if the folder then rewrite a file path as 'path/*.parquet'
Copy link
Contributor

Choose a reason for hiding this comment

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

This will mean a directory of files like foo/my_file.parquet.snappy would not be readable anymore -- I think that spark creates files like my_file.snappy.parquet so it should be ok

@comphead comphead merged commit 59143c1 into apache:main Jun 24, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate datasource Changes to the datasource crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make datafusion read parquet folders if non parquet files exists

2 participants