[#11103] feat(core): Add the hierarchy convention layer#11074
Open
roryqi wants to merge 37 commits into
Open
Conversation
- RelationalSchemaNamingBridge and JDBCBackend entity/relation conversions - SupportsRelationOperations.batchInsertRelations; RelationalEntityStore cache invalidation - RelationalBackend; backend-focused tests Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace Preconditions.checkNotNull with Objects.requireNonNull in JDBCBackend.batchInsertRelations for consistency with the interface - Add @SuppressWarnings explanatory comments in unchecked-cast methods - Document FILESET/TOPIC/MODEL/MODEL_VERSION passthrough in default switch branches of nameIdentifierForStorage/nameIdentifierForApi - Expand Javadoc on embeddedNamespaceForStorage/Api to warn about the index-2 layout assumption - Guard statisticEntityForApi/Storage with Preconditions.checkArgument to reject non-TableStatisticEntity subtypes at the call site - Add tests: roleEntityForStorage/Api round-trips, batchInsertRelations cache invalidation in RelationalEntityStore, and non-OWNER_REL rejection in JDBCBackend.batchInsertRelations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract mapRoleSecurableObjects helper to eliminate the duplicate
builder block shared by roleEntityForStorage and roleEntityForApi
- Extract statisticEntityWithNamespace helper to consolidate the type
guard and builder shared by statisticEntityForApi and
statisticEntityForStorage
- Replace repeated Lists.newArrayList(Privileges.UseSchema.allow()) and
SecurableObjects.ofCatalog("catalog", ...) constructions in tests with
private static final constants USE_SCHEMA_PRIVS and CATALOG_OBJ
- Remove inline WHAT-comments that restate what the assertions already
express
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yStore batchDelete and batchPut were the only write paths that bypassed the cache — callers that relied on them would silently observe stale reads. Apply the same pattern as their single-item counterparts: - batchDelete: invalidate each (ident, entityType) pair after backend - batchPut: put each entity into cache after backend Add unit tests covering the backend-then-cache ordering for both methods. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nalEntityStore" This reverts commit cb21732.
…Identifier-based approach Use the existing nameIdentifierForStorage/Api infrastructure via a sentinel metalake prefix instead of bespoke string-splitting logic. Removes the package-private convertMetadataObjectDottedFullName and convertSchemaSegmentAt helpers; updates securableObjectForStorage/Api and genericEntityMetadataFullNameForApi accordingly. Tests are replaced with equivalent coverage through the public securableObject API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dataObject entity types Entity types without a MetadataObject.Type equivalent (e.g. TABLE_STATISTIC, MODEL_VERSION) must not be schema-converted. Re-add the MetadataObject.Type.valueOf guard that was dropped in the previous refactor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code Coverage Report
Files
|
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.
What changes were proposed in this pull request?
Add abstract class BasePOStorageOps to let all the PO logic to one class
Add SchemaPOStorageOps,TablePOStorageOps,FunctionPOStorageOps,ViewPOStorageOps.
Add Hierachical convention class
Why are the changes needed?
Fix: #11103
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added tests.