mrhhsg opened a new pull request, #67757:
URL: https://github.com/apache/doris/pull/67757

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #65805
   
   Problem Summary:
   
   #65805 introduced the typed DATA/META access-path protocol and keeps 
decoding the legacy all-DATA
   encoding from an old FE. In that legacy decoding, `_split_access_paths()` 
treats any trailing
   `NULL`/`OFFSET` component as current-level metadata. A Struct owns no offset 
metadata, so a legacy
   `[s, offset]` path, which is exactly what an old FE emits for `element_at(s, 
'offset')` on a struct
   whose field is literally named `offset`, was consumed as `OFFSET_ONLY`. 
`descendant_paths` became
   empty, every field iterator was set to SKIP, and the query silently returned 
default values.
   
   Before #65805 that path was routed to the field named `offset`, so this is a 
wrong-result regression
   in the supported BE-first rolling upgrade window (old FE + new BE).
   
   Fix:
   
   - `_split_access_paths()` takes `owns_offset_meta`. Struct passes `false`: a 
legacy `OFFSET` tail
     stays a descendant path and reaches the field named `offset`, and a typed 
META `OFFSET` request on
     a Struct is rejected as an FE/BE contract violation instead of silently 
skipping data. Scalar, Map
     and Array pass `true` and keep treating `OFFSET` as current-level metadata.
   - A legacy `[s, NULL]` keeps its sentinel meaning because an old FE really 
emits it for `s IS NULL`.
   
   Upgrade notes (unchanged from #65805, documented here): BE first, then FE. A 
new FE against an old
   BE fails every nested `IS NULL` / `length()` / `cardinality()` query with 
"path is empty" because the
   old BE reads `data_access_path` from a META path.
   
   Validation:
   
   ```
   sh run-be-ut.sh --run --filter='ColumnReaderTest.*'
   # [  PASSED  ] 57 tests, including the new
   #   LegacyStructOffsetComponentRoutesToDataField / 
TypedMetaOffsetPathOnStructIsRejected
   
   ./run-regression-test.sh --conf <worktree conf> --run -d 
nereids_rules_p0/column_pruning -s null_column_pruning -forceGenOut
   ./run-regression-test.sh --conf <worktree conf> --run -d 
nereids_rules_p0/column_pruning -s null_column_pruning
   # All suites success, new cases !35-!39 on ncp_meta_name_tbl (struct<`null`: 
string, `offset`: string>)
   ```
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] Regression test
       - [x] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   https://claude.ai/code/session_01L4PAEhhJm3BvMHghsT77HA
   


-- 
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]

Reply via email to