Dandandan commented on a change in pull request #9970:
URL: https://github.com/apache/arrow/pull/9970#discussion_r611030976



##########
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:
       What are the exact use cases for summing timestamps? When does it make 
sense?
   It looks like PostgreSQL doesn't support it: 
https://www.postgresql.org/docs/13/functions-aggregate.html




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


Reply via email to