viirya commented on code in PR #7400:
URL: https://github.com/apache/arrow-datafusion/pull/7400#discussion_r1326661420


##########
datafusion/physical-expr/src/aggregate/first_last.rs:
##########
@@ -165,6 +165,8 @@ struct FirstValueAccumulator {
     orderings: Vec<ScalarValue>,
     // Stores the applicable ordering requirement.
     ordering_req: LexOrdering,
+    // Whether merge_batch() is called before

Review Comment:
   The strange part is, you only skip `is_set` in state. But actually `state` 
adds `first`, `orderings` too.
   If your theory is `state` called twice to add doubly, `first` and 
`orderings` should be added doubly too.
   
   And for other accumulators, it is same. Other accumulators might have more 
than one field in its state.
   The strange thing is only `is_set` is skipped. And I don't see why `is_set` 
is so special.



-- 
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]

Reply via email to