Repository navigation
feat(writer): add Table::location_generator that follows table properties
#3730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
smaheshwar-pltr
wants to merge
6
commits into
apache:main
Choose a base branch
from
smaheshwar-pltr:design/core-table-generator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cb224a5
feat(writer): add a location generator that follows table properties
smaheshwar-pltr df3f93a
docs: clarify that DefaultLocationGenerator ignores the table layout
smaheshwar-pltr d746dce
Merge upstream main
smaheshwar-pltr a9b322c
test(writer): simplify location generator tests and docs
smaheshwar-pltr 1597f94
docs(writer): clarify the fixed default file layout
smaheshwar-pltr 5dd75a7
refactor(writer): get the table's location generator from Table
smaheshwar-pltr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote up some context in #3729 on why I've gone with this approach but open to change / discussion if folks have thoughts. A new generator here lets us keep compatibility with current client behaviour, but the downside is that
DefaultLocationGeneratorreads naturally yet may not do what's desired.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IAlso, Java and Python support custom location providers so that is worth considering too w.r.t. the API design we introduce here. I think the proposed design should be able to support that by e.g. adding
Custom(Arc<dyn <ErasedGenerator>)to theLayoutenum)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should consider custom location provider here. enum seems like an acceptable workaround to me, but I don't want to block the custom location provider support for datafusion. Would appreciate more clarity here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(You're right, I'm having a think here on the best shape)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you - on custom providers, I think they'd come in through the catalog builder like storage factories with the catalog handing those to each
Table, notTableMetadata. So I've moved the entry point toTable::location_generator().To check, I POC-ed what custom providers might look like here on top of this API choice i.e.
Table::location_generator()doesn't change meaning e.g. DataFusion picks it up with no changes. (The wiring isLocationGeneratorFactorypassed in throughCatalogBuilder::with_location_generator_factory)Separately, I do wonder why location generators aren't trait objects like
Storage- i.e. if we were building this from scratch, we could passArc<dyn LocationGenerator>around instead with this PR'sTable::location_generator()returning that too. #3738 is what that might look like (this is with custom providers on top).That's breaking so I've kept this PR additive for now, but I am curious for thoughts on that alternative design.