comphead commented on PR #21679:
URL: https://github.com/apache/datafusion/pull/21679#issuecomment-4263918855

   Given the PR size, I asked Claude to make initial review, here are some 
findings
   
   ```
   Findings                                            
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
         
     1. .to_usize().unwrap() → .as_usize() in 
datafusion/common/src/utils/mod.rs                                              
                                                                              
     Lines 1006, 1007, 1025 use .to_usize().unwrap() on arrow offset values. 
The same file already uses the infallible .as_usize() at lines 1109, 1116, 
1117, and the broader codebase does too               
     (functions-nested/src/position.rs). Simple consistency fix — .as_usize() 
does the same thing without the panic risk.                                     
                                              
                                                                                
                                                                                
                                              
     2. Derive lambda_positions from arg_fields in 
HigherOrderFunctionExpr::try_new                                                
                                                                           
     higher_order_function.rs:105-146 — try_new iterates args twice: once to 
build arg_fields (checking downcast_ref::<LambdaExpr>()), then again to build 
lambda_positions (checking is::<LambdaExpr>()).    
     Since arg_fields already encodes which positions are lambdas 
(ValueOrLambda::Lambda vs Value), lambda_positions can be derived from it 
directly, eliminating the redundant iteration and type check.     
                                                                                
                                                                                
                                            
   ``` 
   
   what is `ComparisonExpression ` in the description? 


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