kosiew commented on PR #19524:
URL: https://github.com/apache/datafusion/pull/19524#issuecomment-3701487018

   hi @Jefffrey 
   
   How about:
   
   ```
   impl SubstrFunc {
       pub fn new() -> Self {
           let string = 
Coercion::new_exact(TypeSignatureClass::Native(logical_string()));
           let int64 = Coercion::new_implicit(
               TypeSignatureClass::Native(logical_int64()),
               vec![TypeSignatureClass::Native(logical_int32())],
               NativeType::Int64,
           );
   
           Self {
               signature: Signature::from_parameter_variants(
                   &[
                       vec![("str", string.clone()), ("start_pos", 
int64.clone())],
                       vec![
                           ("str", string.clone()),
                           ("start_pos", int64.clone()),
                           ("length", int64.clone()),
                       ],
                   ],
                   Volatility::Immutable,
               )
               .expect("valid parameter variants"),
               aliases: vec![String::from("substring")],
           }
       }
   }
   ```


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