alamb commented on code in PR #5574:
URL: https://github.com/apache/arrow-datafusion/pull/5574#discussion_r1135636530
##########
datafusion/core/tests/sqllogictests/test_files/aggregate.slt:
##########
@@ -1284,3 +1284,148 @@ NULL 2
statement ok
drop table the_nulls;
+
+# All supported timestamp types
+
+# "nanos" --> TimestampNanosecondArray
+# "micros" --> TimestampMicrosecondArray
+# "millis" --> TimestampMillisecondArray
+# "secs" --> TimestampSecondArray
+# "names" --> StringArray
+
+statement ok
+create table t_source
+as values
+ ('2018-11-13T17:11:10.011375885995', 'Row 0'),
+ ('2011-12-13T11:13:10.12345', 'Row 1'),
+ (null, 'Row 2'),
+ ('2021-1-1T05:11:10.432', 'Row 3');
+
+
+statement ok
+create table t as
+select
+ arrow_cast(column1, 'Timestamp(Nanosecond, None)') as nanos,
+ arrow_cast(column1, 'Timestamp(Microsecond, None)') as micros,
+ arrow_cast(column1, 'Timestamp(Millisecond, None)') as millis,
+ arrow_cast(column1, 'Timestamp(Second, None)') as secs,
+ column2 as names
+from t_source;
+
+# Demonstate the contents
+query PPPPT
+select * from t;
+----
+2018-11-13T17:11:10.011375885 2018-11-13T17:11:10.011375
2018-11-13T17:11:10.011 2018-11-13T17:11:10 Row 0
+2011-12-13T11:13:10.123450 2011-12-13T11:13:10.123450 2011-12-13T11:13:10.123
2011-12-13T11:13:10 Row 1
+NULL NULL NULL NULL Row 2
+2021-01-01T05:11:10.432 2021-01-01T05:11:10.432 2021-01-01T05:11:10.432
2021-01-01T05:11:10 Row 3
+
+
+# aggregate_timestamps_sum() -> Result<()> {
+statement error Error during planning: The function Sum does not support
inputs of type Timestamp\(Nanosecond, None\)
+SELECT sum(nanos), sum(micros), sum(millis), sum(secs) FROM t;
+
+query IIII
Review Comment:
Good idea -- added in 5f77bb002
--
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]