### Describe the bug Current DateTrunc Signature is ``` BuiltinScalarFunction::DateTrunc => Signature::exact( vec![ DataType::Utf8, DataType::Timestamp(TimeUnit::Nanosecond, None), ], fun. Volatility(), ), ``` TimeUnit should also can be `Second` | `millsecond` ... Because return type is determined by `Signature`, so it will cause wrong expect type. ``` explain verbose select arrow_typeof(date_trunc('minute', to_timestamp_seconds(61))); +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | plan_type | plan | +------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ | initial_logical_plan | Projection: arrow_typeof(date_trunc(Utf8("minute"), to_timestamp_seconds(Int64(61)))) | | | EmptyRelation | | logical_plan after inline_table_scan | SAME TEXT AS ABOVE | | logical_plan after type_coercion | Projection: arrow_typeof(date_trunc(Utf8("minute"), CAST(to_timestamp_seconds(Int64(61)) AS Timestamp(Nanosecond, None)))) | | | EmptyRelation | ``` ### To Reproduce _No response_ ### Expected behavior _No response_ ### Additional context _No response_
Activity
alamb commentedon Jun 11, 2023
I will take a shot at working on this