eldenmoon opened a new pull request, #70622: URL: https://github.com/apache/doris/pull/70622
### Background Doris converts tablet schemas between `TabletSchemaPB` and `TabletSchemaCloudPB` when exchanging cloud metadata. The optional `variant_escape_dots_in_keys` field defaults to `false`, while protobuf separately tracks whether it was explicitly set. ### What problem does this PR solve? Issue Number: None Related PR: #69995 (introduced the field) PR Type: Bugfix Problem Summary: Converting a schema without `variant_escape_dots_in_keys` currently turns the absent field into an explicitly set `false`. Check `has_variant_escape_dots_in_keys()` before setting it in both conversion directions and both copy/move implementations, as requested in Gavin's review of #69995. Explicit `false` and `true` values remain present and unchanged; the default value remains `false`. ### Details - **Frequency:** Every conversion of a source schema that omits the field. - **Root cause:** Unconditional protobuf setters materialize the default value and set the presence bit. - **Why existing tests missed it:** The policy round-trip test checked values only, so absence and explicit `false` were indistinguishable. The all-fields tests explicitly populate every field. - **Fix:** Guard the four setters with the matching protobuf presence check. Add absent-field coverage and strengthen explicit-value round trips with presence assertions. - **Other paths and branches:** Both cloud/local directions and const-reference/rvalue overloads are covered; the value-returning wrappers delegate to them. This PR targets master. - **Behavior change:** An omitted optional field remains omitted after conversion; explicit values and effective defaults are unchanged. ### Testing - On dev-x, the new `PBConvertTest.VariantEscapeTablePolicyAbsent` fails before the fix: presence becomes `true` in all four conversion paths for absent input fields. - After the fix, ASAN `./run-be-ut.sh --run --filter="PbConvert.*:PBConvertTest.*:TabletSchemaTest.*"` passes all 42 tests across three suites. This host's UT invocation uses `GLIBC_COMPATIBILITY=OFF` to avoid duplicate compatibility symbols with its LDB toolchain; this is a test-only setting. - clang-format 16, the format check, and changed-line clang-tidy all pass. ### Release note None ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready ### AI Disclosure - Tool: OpenAI Codex (GPT-6) - Generated: Code, tests, and this description. - Human review: Pending author review. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
