mihailotim-db opened a new pull request, #55794:
URL: https://github.com/apache/spark/pull/55794

   ## What changes were proposed in this pull request?
   
   Add SQL query test cases to join-lateral.sql covering lateral join outer 
attribute visibility after NATURAL JOIN and USING JOIN. Specifically:        
      
     1. Lateral after NATURAL JOIN -- unqualified key: verifies the merged join 
key resolves correctly in the lateral subquery.                            
     2. Lateral after NATURAL JOIN -- qualified keys: verifies t1.k and t2.k 
resolve to the original pre-merge columns.
     3. Lateral after USING JOIN -- qualified keys: same as above but with 
explicit USING (k) syntax.                                                      
     4. Lateral cannot see column hidden by subquery alias: verifies that a 
column not in the subquery's output (v1 behind SELECT k FROM ... ORDER BY v1)  
     is not visible to the lateral subquery.                                    
                                                                           
     5. Lateral cannot see column not in GROUP BY output: verifies that a 
column dropped by GROUP BY projection (v1 in SELECT k FROM ... GROUP BY k) is 
not
      visible to the lateral subquery.                                          
                                                                           
                     
   ##  Why are the changes needed?                                              
                                                                             
                     
   The existing join-lateral.sql tests cover NATURAL JOIN and USING JOIN with 
the lateral subquery itself (lines 28-29), but do not test lateral joins 
chained after a NATURAL/USING JOIN -- i.e., whether the merged/qualified/hidden 
columns from the left side are correctly visible or hidden across the lateral 
boundary. These tests close that gap.                                           
                                                              
                     
   ## Does this PR introduce any user-facing change?                            
                                                                            
     
   No.                                                                          
                                                                         
                     
   ## How was this patch tested?
   
    Added test cases                          
                                                                                
                                                                           
   ## Was this patch authored or co-authored using generative AI tooling?
                                                                                
                                                                           
   Generated-by: Claude Code (claude-opus-4-6)  


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