mustafasrepo commented on code in PR #6734:
URL: https://github.com/apache/arrow-datafusion/pull/6734#discussion_r1238779399
##########
datafusion/physical-expr/src/aggregate/first_last.rs:
##########
@@ -117,42 +153,57 @@ impl PartialEq<dyn Any> for FirstValue {
#[derive(Debug)]
struct FirstValueAccumulator {
first: ScalarValue,
- // At the beginning, `is_set` is `false`, this means `first` is not seen
yet.
- // Once we see (`is_set=true`) first value, we do not update `first`.
+ // At the beginning, `is_set` is false, which means `first` is not seen
yet.
Review Comment:
This can be done also, However, in this case we need to store `DataType` in
the state. so that we can produce `NULL` value for correct type, during output
if no value is received before calling `evaluate`. We can pursue either
approach, what do you think? Either we will store `is_set` flag, `DataType` for
the expression inside accumulator.
--
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]