alamb commented on code in PR #7565:
URL: https://github.com/apache/arrow-datafusion/pull/7565#discussion_r1327139693
##########
datafusion/physical-expr/src/aggregate/first_last.rs:
##########
@@ -550,4 +559,72 @@ mod tests {
assert_eq!(last_accumulator.evaluate()?, ScalarValue::Int64(Some(12)));
Ok(())
}
+
+ #[test]
+ fn test_first_last_state_after_merge() -> Result<()> {
+ let ranges: Vec<(i64, i64)> = vec![(0, 10), (1, 11), (2, 13)];
+ // create 3 ArrayRefs between each interval e.g from 0 to 9, 1 to 10,
2 to 12
+ let arrs = ranges
+ .into_iter()
+ .map(|(start, end)| {
+ Arc::new(Int64Array::from((start..end).collect::<Vec<_>>()))
as ArrayRef
Review Comment:
I think you can collect the array directly
```suggestion
Arc::new((start..end).collect::<Int64Array>())) as ArrayRef
```
--
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]