Commits

Andrew Lamb authored 1ed681912be
ARROW-12277: [Rust][DataFusion] Implement Sum/Count/Min/Max aggregates for Timestamp(_,_) # Rationale: If you try and aggregate (via SUM, for example) a column of a timestamp type, DataFusion generates an error: ``` Coercion from [Timestamp(Nanosecond, None)] to the signature Uniform(1, [Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, Float64]) failed. ``` For example, from IOx ``` > show columns from t; +---------------+--------------+------------+-------------+-----------------------------+-------------+ | table_catalog | table_schema | table_name | column_name | data_type | is_nullable | +---------------+--------------+------------+-------------+-----------------------------+-------------+ | datafusion | public | t | a | Utf8 | NO | | datafusion | public | t | b | Timestamp(Nanosecond, None) | NO | +---------------+--------------+------------+-------------+-----------------------------+-------------+ 2 row in set. Query took 0 seconds. > select sum(b) from t; Plan("Coercion from [Timestamp(Nanosecond, None)] to the signature Uniform(1, [Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, Float64]) failed.") ``` # Changes: Add support for aggregating timestamp types and tests for same # Notes Note this is follow on / more fleshing out of the work done in #9773 by @velvia (👋 thanks for adding Timestamps to `ScalarValue`) Supporting AVG on timestamps is tracked by https://issues.apache.org/jira/browse/ARROW-12318. It is more involved (as currently Avg assumes the output type is always F64), and not important for myuse case at the moment. Closes #9970 from alamb/alamb/ARROW-12277-aggregate-timestamps Authored-by: Andrew Lamb <andrew@nerdnetworks.org> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>