Repository navigation
Treat the exists namespace property as reserved in SqlCatalog - #4531
Open
gedaliakliger wants to merge 1 commit into
Open
gedaliakliger wants to merge 1 commit into
gedaliakliger wants to merge 1 commit into
Conversation
Always store the exists marker in create_namespace, hide it from load_namespace_properties and reject it in update_namespace_properties, as Java's JdbcCatalog does.
This branch has not been deployed
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.
Closes #4525
Rationale for this change
SqlCatalognow handles theexistsnamespace property the way Java'sJdbcCatalogdoes:create_namespacealways storesexists=truenext to the given properties (JdbcCatalog.createNamespace).load_namespace_propertiesno longer returns it (JdbcCatalog.loadNamespaceMetadata).update_namespace_propertiesraisesValueError("Cannot set reserved property: exists")whenupdatescontains it (JdbcCatalog.setProperties).create_namespaceraises the same error; Java fails there too, becausebuildOrThrowrejects the duplicate key.Two deviations from Java:
existsis skipped and reported undermissing.JdbcCatalog.removePropertieshas no guard and would delete the row. Since the property is hidden fromload_namespace_properties, deleting it would contradict the returned summary.Are these changes tested?
Yes.
test_namespace_rejects_reserved_exists_propertyandtest_namespace_created_with_properties_survives_external_property_removalare new, andtest_load_empty_namespace_propertiesandtest_update_namespace_properties_removes_all_propertiesnow expect{}. The four fail onmain(28 cases) and pass with this change.Ran locally:
pytest tests/catalog/test_catalog_behaviors.py tests/catalog/test_sql.py tests/catalog/test_base.py tests/cli -m unit(971 passed), and ruff, ruff-format and mypy on the changed files. The full suite and the integration tests are left to CI.Are there any user-facing changes?
Yes, for the release notes:
load_namespace_propertieson aSqlCatalogorInMemoryCatalogno longer returnsexists. A namespace created without properties returns{}instead of{"exists": "true"}.create_namespaceandupdate_namespace_propertiesraiseValueErrorwhen givenexistsas a property key.