jayzhan211 commented on issue #8984:
URL:
https://github.com/apache/arrow-datafusion/issues/8984#issuecomment-1913433987
@alamb I'm trying to add `ordering_req` in `AggregateUDFImpl`. But
`LexOrdering` is physical_expr, importing it causes cyclic dependency.
```rust
/// Returns the lexical ordering requirements of the aggregate
expression.
fn ordering_req(&self) -> &LexOrdering {
&self.ordering_req
}
```
I'm testing with `FirstValueAccumulator` which has argument `ordering_req:
LexOrdering`, so I need to convert from Expr::Sort to LexOrdering somewhere.
Both `OrderSensitiveArrayAgg` and `FirstValue` includes `ordering_req:
LexOrdering`. However, I'm not sure how can I have LexOrdering for
AggregateUDFImpl without cyclic dependency.
If `ordering_req` return with `Vec<datafusion_expr::Expr>` instead of
`LexOrdering`, then UDF caller needs to convert Expr::Sort to LexOrdering by
themself inside their accumulator like
`FirstValueUDFAccumulator::new(data_type: &DataType, ordering_req:
Option<Vec<Expr>>),` not sure does it make sense
--
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]