Repository navigation
Allow staging table creation with the same name. - #1230
Merged
Merged
Conversation
yili-db
requested review from
dennyglee,
rameshchandra and
tdas
as code owners
November 19, 2025 23:46
yili-db
force-pushed
the
staging_table_dup
branch
from
November 20, 2025 00:36
e4bcb4c to
dd0a1c1
Compare
yili-db
commented
Nov 20, 2025
| @Table( | ||
| name = "uc_staging_tables", | ||
| indexes = { | ||
| @Index(name = "idx_name", columnList = "name"), |
Collaborator
Author
There was a problem hiding this comment.
Name no longer matters. We no longer query by name. It's OK to have multiple entries with the same name too.
This is to fix a bug that UC didn't allow a 2nd staging table to be created using the same name. However this is actually a valid use case. When the table creation failed after the staging table is created by before the table creation, the dangling staging table would prevent retrying effort to create the table using the same name again. We have to allow the staging table to be created again using the same name to get it through. The new staging table will have new ID and location so it won't be a problem anyway. Signed-off-by: Yi Li <[email protected]>
yili-db
force-pushed
the
staging_table_dup
branch
from
November 20, 2025 00:39
dd0a1c1 to
96ceb01
Compare
yili-db
commented
Nov 20, 2025
| this.serverProperties = serverProperties; | ||
| } | ||
|
|
||
| private StagingTableDAO findBySchemaIdAndName(Session session, UUID schemaId, String name) { |
Collaborator
Author
There was a problem hiding this comment.
No longer need to query by name.
yili-db
commented
Nov 20, 2025
| Session session, UUID schemaId, String tableName, String stagingLocation) { | ||
| // check if staging table or table by the same name already exists | ||
| // Also ensure that no staging table exists at the same location | ||
| StagingTableDAO existingStagingTable = findBySchemaIdAndName(session, schemaId, tableName); |
Collaborator
Author
There was a problem hiding this comment.
This is the actual change. Skip searching for staging table by name. Allow duplicate names to be used again.
tdas
approved these changes
Nov 20, 2025
yili-db
added a commit
to yili-db/unitycatalog
that referenced
this pull request
Nov 20, 2025
**PR Checklist** - [X] A description of the changes is added to the description of this PR. - [X] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** This is to fix a bug that UC didn't allow a 2nd staging table to be created using the same name. However this is actually a valid use case. When the table creation failed after the staging table is created but before the table creation, the dangling staging table would prevent retrying effort to create the table using the same name again. We have to allow the staging table to be created again using the same name to get it through. The new staging table will have new ID and location so it won't be a problem anyway. **Related issue** unitycatalog#1143 Signed-off-by: Yi Li <[email protected]>
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.
PR Checklist
docsis updatedDescription of changes
This is to fix a bug that UC didn't allow a 2nd staging table to be created using the same name. However this is actually a valid use case. When the table creation failed after the staging table is created but before the table creation, the dangling staging table would prevent retrying effort to create the table using the same name again. We have to allow the staging table to be created again using the same name to get it through. The new staging table will have new ID and location so it won't be a problem anyway.
Related issue
#1143