yyy1000 commented on code in PR #9172: URL: https://github.com/apache/arrow-datafusion/pull/9172#discussion_r1483820052
########## docs/source/library-user-guide/adding-udfs.md: ########## @@ -74,11 +139,10 @@ assert_eq!(result, &Int64Array::from(vec![Some(2), None, Some(4)])); The challenge however is that DataFusion doesn't know about this function. We need to register it with DataFusion so that it can be used in the context of a query. -### Registering a Scalar UDF +#### Registering a Scalar UDF To register a Scalar UDF, you need to wrap the function implementation in a [`ScalarUDF`] struct and then register it with the `SessionContext`. DataFusion provides the [`create_udf`] and helper functions to make this easier. -There is a lower level API with more functionality but is more complex, that is documented in [`advanced_udf.rs`]. Review Comment: I doubt a little that whether my PR is necessary, it seems that there's already a updated link that helps user create scalarUDF by `impl trait`. 🤔 What do you think ? @alamb -- 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]
