englefly commented on PR #69340:
URL: https://github.com/apache/doris/pull/69340#issuecomment-6306636491

   ### Reply to the review: `[P1] Limit container metadata routing to 
root-level requests`
   
   Addressed in 5d0d5dc6f36 (also replied inline at #discussion_r4332426708).
   
   **What changed**
   
   - `collectArrayMapPathInLambda` now routes OFFSET/NULL to the input arrays 
only for a *root* container request: `isRootContainerMetadata` requires the 
pending metadata path to be exactly `[OFFSET]` or `[NULL]`.
   - A prefixed request such as the `[*, OFFSET]` of 
`cardinality(element_at(array_map(...), 1))` keeps the previous 
`collectArrayPathInLambda` traversal: the metadata produced by the lambda is 
dropped and the lambda payload is preserved, so no element-level metadata path 
is emitted.
   - Added unit case `testArrayMapResultElementMetadataKeepsLambdaPayloadOnly` 
and regression cases `array_map_result_element_cardinality` / 
`array_map_result_element_is_null`, with explain guards for a selected 
ARRAY_MAP result whose element type differs from the input.
   
   **Verification** (`a ARRAY<STRUCT<v:INT>>`, local FE/BE cluster)
   
   | query | before 5d0d5dc6f36 | after 5d0d5dc6f36 |
   | --- | --- | --- |
   | `cardinality(element_at(array_map(x -> array(x.v), a), 1))` | `all access 
paths: [a.*.v, a.*.OFFSET]` → `[E-3110] Invalid META access path ... OFFSET 
metadata is not supported at this level` | `all access paths: [a.*.v]` → `1, 
NULL, NULL` (same as nested column pruning disabled) |
   | `element_at(array_map(x -> array(x.v), a), 1) IS NULL` | — | `all access 
paths: [a.*.v]` → `0, 1, 1` |
   | `cardinality(array_map(x -> x, a))` (root, unchanged goal) | 
`[a.*.OFFSET]` → E-3110 | `[a.*, a.OFFSET]` → `2, 0, NULL, 2` |
   
   Root container routing is unchanged for the struct field (`[s.arr.*, 
s.arr.OFFSET]`), map value (`[m.KEYS, m.VALUES.*, m.VALUES.OFFSET]`), 
multi-input (`[a.*, a.OFFSET, b.*, b.OFFSET]`) and `IS NULL` (`[a.*, a.NULL]`) 
cases.
   
   **Tests**
   
   - Unit: `PruneNestedColumnTest` passes 79/79, including the new case.
   - Regression: the whole `nereids_rules_p0/column_pruning` directory (16 
suites) passes; the new suite now has 8 result sections and 7 explain guards.
   - A new `/review` has been requested on 5d0d5dc6f36.
   


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