Pass SessionState to TableProvider::scan#2660
Merged
Merged
Conversation
tustvold
force-pushed
the
session-state-table-provider
branch
from
May 30, 2022 19:24
b757bb7 to
3290e26
Compare
tustvold
commented
May 30, 2022
| Arc::new(TaskContext::from(self)) | ||
| } | ||
|
|
||
| /// Get a copy of the [`SessionState`] of this [`SessionContext`] |
Contributor
Author
There was a problem hiding this comment.
I'm not a massive fan of this, but it appears to be what we do already for every query and when constructing a TaskContext, so it can't be that bad..........
tustvold
force-pushed
the
session-state-table-provider
branch
from
May 30, 2022 19:27
3290e26 to
4ae3b42
Compare
Contributor
Author
|
Will fix ballista after apache/datafusion-ballista#48 and apache/datafusion-ballista#49 |
alamb
reviewed
May 31, 2022
alamb
left a comment
Contributor
There was a problem hiding this comment.
cc @andygrove as I believe he is working on disconnecting the logical and physical plans in DataFusion and I want to make sure this doesn't mess up his plans
Otherwise looks good to me though
andygrove
approved these changes
May 31, 2022
Contributor
Author
|
My understanding is that #2569 removed the dependency of LogicalPlan on TableProvider |
pull Bot
pushed a commit
to buraksenn/datafusion
that referenced
this pull request
Jun 17, 2026
…tions` (apache#22969) ## Which issue does this PR close? - Closes #. ## Rationale for this change Something that was spotted during the review of: - apache#22657 `ListingOptions::target_partitions` and `ListingOptions::collect_stat` duplicate `SessionConfig`'s `execution.target_partitions` and `execution.collect_statistics`. After some investigation, I think they only live on `ListingOptions` for historical reasons: when the struct was added (apache#1010 5 years ago), `TableProvider::scan` had no access to the session, so the values had to be copied onto the table at build time. Once apache#2660 passed `SessionState` into `scan`, the fields became redundant (and had already drifted — `scan` read them from the session config while `list_files_for_scan` read the stale copy). This PR makes `SessionConfig` the single source of truth. ## What changes are included in this PR? - Remove `target_partitions`/`collect_stat` fields, their builders, and `with_session_config_options` from `ListingOptions`. - `ListingTable` now reads both values from the session config at scan time. - Reserve proto tags 8/9 in `ListingTableScanNode` and drop the related (de)serialization. - Update benchmarks, factory, and test call sites. ## Are these changes tested? Yes, by existing tests ## Are there any user-facing changes? Yes, breaking: the removed fields/builders require configuring `SessionConfig` instead, and the two proto fields no longer round-trip. --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2658
Closes #2657
Rationale for this change
Prevents circular references, and will also allow TableProviders access to things like the RuntimeEnv, etc...
What changes are included in this PR?
Passes a
&SessionStatetoTableProvider::scan, this is necessary forTableProviderto be able to access plan state without potentially introducing circular references.Are there any user-facing changes?
Yes, this changes the signature of TableProvider::scan
Does this PR break compatibility with Ballista?
Possibly