lxy-9602 commented on code in PR #427:
URL: https://github.com/apache/paimon-cpp/pull/427#discussion_r4247073294
##########
src/paimon/core/operation/read_context.cpp:
##########
@@ -380,6 +432,19 @@ Result<std::unique_ptr<ReadContext>>
ReadContextBuilder::Finish() {
if (impl_->enable_multi_thread_row_to_batch_ &&
impl_->row_to_batch_thread_number_ <= 0) {
return Status::Invalid("row to batch thread number should be greater
than 0");
}
+ // A read that goes through a catalog says which table it started from,
which is what lets the
+ // metastore authorize a dependency table - the blob table behind a
BlobView - through the owner
+ // of that table. Mirrors the Java
`CatalogEnvironment.dependencyReadContext()` and both of its
+ // guards: only a REST metastore understands the header, and a value
already there wins, so a
+ // chain of views reports its outermost one instead of the innermost. It
travels in the options,
+ // which `TableRead::Create` merges into the table options and the blob
view read then hands to
+ // the catalog it reads the dependency table through, so it reaches that
request with no second
+ // channel to keep in step.
+ if (impl_->identifier_ && IsRestMetastore(impl_->options_) &&
+ impl_->options_.count(kReadViaOption) == 0) {
+ impl_->options_[kReadViaOption] =
+
UrlUtils::EncodeString(IdentifierToFlatJson(impl_->identifier_.value()));
+ }
Review Comment:
This could break if `identifier` and `branch` don’t correspond.
Alternatively, unify how we parse `identifier`, `WithBranch()`, and the
`branch` option: validate that they are consistent, and then use the
actually-read branch to construct `X-Paimon-Read-Via`.
--
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]