JingsongLi commented on code in PR #9148:
URL: https://github.com/apache/paimon/pull/9148#discussion_r3818249072
##########
paimon-python/pypaimon/utils/blob_view_lookup.py:
##########
@@ -139,6 +137,22 @@ def resolve_uri_reader(self, view_struct: BlobViewStruct)
-> UriReader:
)
return uri_reader
+ def resolve_uri_reader_for_uri(self, uri: str) -> Optional[UriReader]:
+ """UriReader bound to the upstream table that produced this
descriptor."""
+ return self._uri_reader_by_uri.get(uri)
+
+ def _store_chunk_results(self, descriptors, null_values):
+ self._descriptor_cache.update(descriptors)
+ self._null_value_cache.update(null_values)
+ for view_struct, descriptor in descriptors.items():
+ factory = self._uri_reader_factory_cache.get(
+ view_struct.identifier.get_full_name())
+ if factory is not None:
+ # from_file_io: HTTP(S) stays on HttpUriReader; other URIs
+ # reuse the upstream table FileIO (REST table token).
+ self._uri_reader_by_uri[descriptor.uri] = factory.create(
Review Comment:
[P1] Keep reader ownership per originating BlobView, not only per URI. Two
upstream tables can legally produce the same descriptor URI while carrying
different REST table-scoped credentials. `_store_chunk_results` then overwrites
the first reader with whichever table finishes last (nondeterministically in
the parallel path), and `OffsetRow._blob_from_descriptor_field_bytes` routes
every matching descriptor through that one token. I reproduced this with two
token-aware FileIOs and the same `s3://shared/blob` descriptor: after storing A
then B, both rows read B. Under real table-level permissions, one source
therefore gets a 403. Please preserve the source-table/row association through
Stage 1 instead of collapsing it to a URI-only map, and add a
two-upstream-table/same-URI regression.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]