jayzhan211 commented on code in PR #11696:
URL: https://github.com/apache/datafusion/pull/11696#discussion_r1696231200
##########
datafusion/expr/src/udaf.rs:
##########
@@ -249,6 +249,14 @@ impl AggregateUDF {
pub fn simplify(&self) -> Option<AggregateFunctionSimplification> {
self.inner.simplify()
}
+
+ /// Returns true if the function is max, false if the function is min
+ /// None in all other cases, used in certain optimizations or
+ /// or aggregate
+ ///
+ pub fn get_minmax_desc(&self) -> Option<bool> {
Review Comment:
let field = aggr.field()
let is_sorted_descending = aggr.is_sorted_descending()
And, I think getting field and descending separately is better than
`get_minmax_desc`, so if we can get `field` independently if we don;t care
about descending
##########
datafusion/expr/src/udaf.rs:
##########
@@ -249,6 +249,14 @@ impl AggregateUDF {
pub fn simplify(&self) -> Option<AggregateFunctionSimplification> {
self.inner.simplify()
}
+
+ /// Returns true if the function is max, false if the function is min
+ /// None in all other cases, used in certain optimizations or
+ /// or aggregate
+ ///
+ pub fn get_minmax_desc(&self) -> Option<bool> {
Review Comment:
```rust
let field = aggr.field()
let is_sorted_descending = aggr.is_sorted_descending()
```
And, I think getting field and descending separately is better than
`get_minmax_desc`, so if we can get `field` independently if we don;t care
about descending
--
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]