zjw1111 commented on code in PR #527:
URL: https://github.com/apache/paimon-cpp/pull/527#discussion_r4547335916
##########
src/paimon/core/table/system/system_table.cpp:
##########
@@ -255,7 +331,12 @@ Result<std::shared_ptr<SystemTable>>
SystemTableLoader::LoadFromPath(
if (parsed.branch) {
options[Options::BRANCH] = parsed.branch.value();
}
- return Load(parsed.system_table_name, fs, parsed.table_path,
latest_schema.value(), options);
+ // Preserve branch-qualified logical names when deriving identifiers from
paths.
+ const Identifier data_identifier(Identifier::kUnknownDatabase,
+ PathUtil::GetName(parsed.table_path),
+ parsed.branch.value_or(std::string()));
+ return Load(parsed.system_table_name, fs, parsed.table_path,
latest_schema.value(), options,
Review Comment:
Java can hit the same mismatch. In Flink, `tbl$ro` with
`OPTIONS('branch'='dev')` applies the branch option to a copy of the already
loaded table, so it can read `dev` using `main`'s schema. Loading
`tbl$branch_dev$ro` or calling `switchToBranch("dev")` loads the `dev` schema.
[Java
source](https://github.com/apache/paimon/blob/d98f08784c/paimon-core/src/main/java/org/apache/paimon/table/system/ReadOptimizedTable.java#L199-L212)
--
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]