fix: Handle hudi table reads when databaseName is not set during initTable #17695
+70
−2
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.
Describe the issue this Pull Request addresses
Fixes an issue where Hudi tables fail to load with IllegalArgumentException: "is not a Hudi table" when hoodie.database.name is not set in the table config during initialization. This occurs because when both table.identifier.database and getCurrentDatabase are null/empty during table initialization, the database name is not defaulted to "default", causing inconsistent behavior between table creation and querying.
Summary and Changelog
Tables initialized without an explicit database name now correctly default to "default" database, preventing subsequent read failures.
Impact
No public API changes. This is an internal fix to ensure consistent behavior.
Risk Level
Low
Documentation Update
None.
Contributor's checklist