alamb opened a new pull request, #8079:
URL: https://github.com/apache/arrow-datafusion/pull/8079

   ## Which issue does this PR close?
   Part of https://github.com/apache/arrow-datafusion/issues/8045
   
   Closes https://github.com/apache/arrow-datafusion/pull/8039
   
   
   ## Rationale for this change
   
   Rationale is that we can add new features to ScalarUDF to bring it up to 
parity with BuiltInScalarFunction (such as adding `montonicity`) in a backwards 
compatible way if the fields are not pub. If the fields
   
   In order to maintain parity with the other user defined APIs (aggregates and 
window functions) and to prepare them for an eventual consolidation as well, 
apply the same to `AggregateUDF` and `WindowUDF`
   
   see https://github.com/apache/arrow-datafusion/issues/8045 for more details
   
   ## What changes are included in this PR?
   Make all fields of ScalarUDF private and add accessors.
   2. Change return_type to just call the function rather than passing back a 
function implementation
   
   ## Are these changes tested?
   yes, by existing tests
   
   ## Are there any user-facing changes?
   yes, users can no longer create `ScalarUDF`, `AggregateUDF` or `WindowUDF` 
with the `struct` syntax:
   
   So previously this was allowed:
   ```rust
   let udf = ScalarUDF {
     name: "foo".to_string()
     signature, 
     return_type,
     fun
   }
   ```
   
   Now, users must call `ScalarUDF::new`:
   
   ```rust
   let udf = ScalarUDF::new(
     "foo",
     signature, 
     return_type,
     fun
   );
   ```
   
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->
   


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