Skip to content

Conversation

@petern48
Copy link
Contributor

@petern48 petern48 commented Nov 9, 2025

Which issue does this PR close?

Rationale for this change

Allows constructing CachedParquetFileReader::new() manually, allowing users to create it with a custom object reader (inner) object.

What changes are included in this PR?

Adds a simple constructor for CachedParquetFileReader

Are these changes tested?

Added a test

Are there any user-facing changes?

Yes, new constructor available

@github-actions github-actions bot added the datasource Changes to the datasource crate label Nov 9, 2025
@petern48
Copy link
Contributor Author

petern48 commented Nov 9, 2025

I largely just scrapped together some sort of test by pulling from existing test code in row_group_filter.rs, just to check that the constructor is hooked up. Happy the change it, if anyone has better ideas to improve it.

@petern48 petern48 marked this pull request as ready for review November 9, 2025 23:04
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 for this @petern48 -- I have a suggestion -- let me know what you think

use object_store::{memory::InMemory, path::Path, ObjectMeta, ObjectStore};

#[tokio::test]
async fn cached_parquet_file_reader() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of a test just to test new, how about changing the existing code to call new() rather than constructing CachedParquetFileReader directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. It did feel very odd to write a test for it. I was thinking we should protect against removing new(), but I guess there isn't a reason someone would just remove the constructor and go back to building the struct manually in that code.

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.

Looks good to me -- thanks @petern48

@alamb alamb added this pull request to the merge queue Nov 12, 2025
Merged via the queue into apache:main with commit 6af5c95 Nov 12, 2025
28 checks passed
@petern48 petern48 deleted the CachedParquetFileReader_new branch November 12, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CachedParquetFileReader new method or constructor

2 participants