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

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   `AccessPathExpressionCollector` previously associated Lambda arguments with 
their
   bound arrays by argument name and only searched the innermost Lambda scope.
   
   For a nested Lambda that captures an argument from an outer Lambda, the 
captured
   `ArrayItemSlot` cannot be resolved from the innermost scope. This causes its
   nested-column access path to be missed.
   
   For example:
   
   ```sql
   array_map(
       m -> array_map(
           x -> element_at(map_values(m)[0], 'a'),
           [1]
       ),
       element_at(s, 'data')
   )
   ```
   The inner Lambda captures m from the outer Lambda. The collector should 
produce:`s.data.*.VALUES.a`
   
   ### What is changed?
   
   - Associate Lambda arguments with their input expressions using ExprId 
instead of argument names.
   - Search Lambda scopes from the innermost scope to the outermost scope when 
resolving an ArrayItemSlot.
   - Add a regression test for nested Lambda capture and nested-column pruning.
   


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