jgoday commented on pull request #687:
URL: https://github.com/apache/arrow-datafusion/pull/687#issuecomment-874356594


   I have a few doubts:
   
   1) **Lag/Lead** signatures has to be changed to support 2nd/3nd optional 
arguments, is this correct or am I misunderstanding the use of 
**Signature::OneOf** ?
   ```rust
   Signature::OneOf(vec![
       Signature::Any(1),
       Signature::Any(2),
       Signature::Any(3),
   ])
   ```
   
   2) If previous point is correct, then evaluation of **Signature::OneOf** in 
**type_coercion::get_valid_types** has to be changed to something like this 
   ```rust
   Signature::OneOf(types) => {
       let mut r = vec![];
       for s in types {
           // we must ensure that one of the signatures is valid against the 
current_types
           if let Ok(valid_types) = get_valid_types(s, current_types) {
               r.extend(valid_types);
           }
       }
       r
   }
   ```
   original code is currently forcing all options within **Signature::OneOf** 
to be valid
   ```rust
   Signature::OneOf(types) => {
       let mut r = vec![];
       for s in types {
           r.extend(get_valid_types(s, current_types)?);
       }
       r
   }
   ```
   
   3) I'd like to test **create_built_in_window_expr** with the optional 
arguments on and off, to match against the **lead/lag** signatures,
   but How can I test the resulting **WindowShift** struct?
   Right now, I can only try that the presence or absence of this optional 
arguments don't panic in 
**test_create_window_exp_lead_no_args/test_create_window_exp_lead_with_args**
   
   4) Had to copy and change the original 
**arrow::compute::kernels::window::shift** to allow filling the start/end nulls 
with the default value (this new fn is called **shift_with_default_value** 
inside lead_lag crate)
   
   


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


Reply via email to