jayzhan211 commented on code in PR #10091:
URL:
https://github.com/apache/arrow-datafusion/pull/10091#discussion_r1566570013
##########
datafusion/optimizer/src/replace_distinct_aggregate.rs:
##########
@@ -92,14 +90,13 @@ impl OptimizerRule for ReplaceDistinctWithAggregate {
let aggr_expr = select_expr
.iter()
.map(|e| {
- Expr::AggregateFunction(AggregateFunction::new(
- AggregateFunctionFunc::FirstValue,
+ create_first_value_expr(
Review Comment:
Argument support in macro is another todo.
```rust
// "fluent expr_fn" style function
#[doc = $DOC]
pub fn $EXPR_FN($($arg: Expr),*) -> Expr {
Expr::AggregateFunction(datafusion_expr::expr::AggregateFunction::new_udf(
$AGGREGATE_UDF_FN(),
vec![$($arg),*],
// TODO: Support arguments for `expr` API
false,
None,
None,
None,
))
}
```
--
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]