jayzhan211 commented on code in PR #10560:
URL: https://github.com/apache/datafusion/pull/10560#discussion_r1626750687
##########
datafusion-examples/examples/advanced_udaf.rs:
##########
@@ -412,7 +412,7 @@ async fn main() -> Result<()> {
let df = ctx.table("t").await?;
// perform the aggregation
- let df = df.aggregate(vec![], vec![geometric_mean.call(vec![col("a")])])?;
+ let df = df.aggregate(vec![],
vec![geometric_mean.call(vec![col("a")]).build()])?;
Review Comment:
It looks good to me to have both style for function call.
How about the API call in expr_fn? UDAF (`geometric_mean`) is not a free
function that could be called anywherem, it can only be retrieved from function
registry. API call in expr_fn might be used more frequently.
Should we introduce builder mode?
Current state:
expr_fn::first_value(args, distinct, filter, order_by, null_treatment)
Builder mode:
expr_fn::first_value_builder(args).build()
--
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]