[core] Add access context for blob view fallback#7985
Conversation
63532c3 to
7dd0b43
Compare
7dd0b43 to
9c185a8
Compare
JingsongLi
left a comment
There was a problem hiding this comment.
LGTM. Clean design for distinguishing blob-view fallback access from direct table queries. This is important for permission systems that need to know the access origin.
The approach is well-structured:
TableAccessContextis a simple, serializable value type with factory methods- Default method overloads on
Cataloginterface maintain backwards compatibility CatalogEnvironmentcarries the context through to scans and blob resolutionDelegateCatalogandPrivilegedCatalogproperly propagate the new overloads
One minor thought: the TableAccessContext.direct() factory creates a new instance each call. Since it's immutable and always the same, you could cache it as a static constant to avoid allocation in hot paths (e.g., private static final TableAccessContext DIRECT = new TableAccessContext(AccessType.DIRECT, null)). Not a blocker.
+1
JingsongLi
left a comment
There was a problem hiding this comment.
This PR needs more discussion about REST integration.
|
I re-checked the latest state. This still needs the REST integration discussion from the existing requested-changes review before I would consider it ready. |
Purpose
Blob view resolution may need to access an upstream blob table while users are querying a downstream blob-view table. Permission systems need to distinguish this fallback access from a direct upstream table query.
Changes
TableAccessContextto describe table access origins.Catalog#getTableandCatalog#authTableQuerydefault overloads.CatalogEnvironmentso scans can pass the same context to query auth.BLOB_VIEW_FALLBACKcontext fromDataEvolutionTableRead/BlobViewLookupwhen resolving upstream blob descriptors and URI readers.Tests
mvn -pl paimon-core -DskipITs -Dspotless.check.skip=true -Dcheckstyle.skip=true -Dtest=CatalogAccessContextTest testmvn -pl paimon-core -DskipITs -DskipTests -Dspotless.check.skip=true -Dcheckstyle.skip=true test-compile