fix(glue): Support create_table_transaction for S3 Tables federated databases#3210
Open
jamesbornholt wants to merge 1 commit intoapache:mainfrom
Open
Conversation
…atabases
For S3 Tables, the warehouse location is managed by S3 Tables and only
available after a Glue table entry is created. create_table() already
handled this via _create_table_s3tables(), but create_table_transaction()
went through the base class path which failed with 'No default path is
set'.
This adds a create_table_transaction() override on GlueCatalog that, for
S3 Tables federated databases:
1. Pre-creates a minimal Glue table entry so S3 Tables allocates storage
2. Retrieves the managed location from the Glue table
3. Builds the staged table targeting that managed location
4. Returns an _S3TablesCreateTableTransaction that cleans up the
staging table on abort/failure
Also refactors commit_table() to handle the case where a Glue table
exists but has no metadata_location yet (the staging table case),
branching on current_glue_table instead of current_table for the
update-vs-create decision.
1be0018 to
5e105ad
Compare
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.
Rationale for this change
For S3 Tables, the warehouse location is managed by S3 Tables and only available after a Glue table entry is created. create_table() already handled this via _create_table_s3tables(), but create_table_transaction() went through the base class path which failed with 'No default path is set'.
This adds a create_table_transaction() override on GlueCatalog that, for S3 Tables federated databases:
Also refactors commit_table() to handle the case where a Glue table exists but has no metadata_location yet (the staging table case), branching on current_glue_table instead of current_table for the update-vs-create decision.
Are these changes tested?
Yes, new unit tests for this path, and I've also tested against the service directly.
Are there any user-facing changes?
No, this just fixes a code path that is currently failing.