velvia commented on a change in pull request #9970:
URL: https://github.com/apache/arrow/pull/9970#discussion_r611954223
##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -1403,6 +1403,128 @@ mod tests {
Ok(())
}
+ #[tokio::test]
+ async fn aggregate_timestamps_sum() -> Result<()> {
+ let tmp_dir = TempDir::new()?;
+ let mut ctx = create_ctx(&tmp_dir, 1)?;
+ ctx.register_table("t", test::table_with_timestamps())
+ .unwrap();
+
+ let results = plan_and_collect(
+ &mut ctx,
+ "SELECT sum(nanos), sum(micros), sum(millis), sum(secs) FROM t",
+ )
+ .await
+ .unwrap();
+
+ let expected = vec![
Review comment:
That's a good question. I can think of great uses for avg, and
difference (latency between two timestamps), but not really for sum, other than
that sum is an important part of computing average?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]