Skip to content

Conversation

@tustvold
Copy link
Contributor

@tustvold tustvold commented May 31, 2022

Which issue does this PR close?

Part of #2489

Rationale for this change

Manually plumbing the ObjectStore around introduces the potential for inconsistency, increases code complexity, and complicates plan serialization.

What changes are included in this PR?

Follows on from #2578 (comment) and removes the ObjectStore from FileScanConfig and ListingTableConfig, instead determining them as needed from the session context.

Are there any user-facing changes?

Yes, this changes the API of FileScanConfig and ListingTableConfig.

Does this PR break compatibility with Ballista?

Probably...

@tustvold tustvold added the api change Changes the API exposed to users of the crate label May 31, 2022
@github-actions github-actions bot added core Core DataFusion crate datafusion labels May 31, 2022
@github-actions github-actions bot added the development-process Related to development process of DataFusion label May 31, 2022
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

/// Infer `ListingOptions` based on `table_path` suffix.
pub async fn infer_options(self) -> Result<Self> {
pub async fn infer_options(self, ctx: &SessionState) -> Result<Self> {
let store = ctx.runtime_env.object_store(&self.table_path)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

let mock_store =
TestObjectStore::new_arc(&files.iter().map(|f| (*f, 10)).collect::<Vec<_>>());
let ctx = SessionContext::new();
register_test_store(&ctx, &files.iter().map(|f| (*f, 10)).collect::<Vec<_>>());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is cool

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

Labels

api change Changes the API exposed to users of the crate core Core DataFusion crate development-process Related to development process of DataFusion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants