waitingkuo commented on PR #5818:
URL:
https://github.com/apache/arrow-datafusion/pull/5818#issuecomment-1499544976
@Weijun-H
you could do something like this:
```rust
match input_expr_types[0] {
DataType::Timestamp(TimeUnit::Nanosecond, _) =>
Ok(DataType::Timestamp(TimeUnit::Nanosecond, None)),
DataType::Timestamp(TimeUnit::Microsecond, _) =>
Ok(DataType::Timestamp(TimeUnit::Microsecond, None)),
DataType::Timestamp(TimeUnit::Millisecond, _) =>
Ok(DataType::Timestamp(TimeUnit::Millisecond, None)),
DataType::Timestamp(TimeUnit::Second, _) =>
Ok(DataType::Timestamp(TimeUnit::Second, None)),
_ => return Err(DataFusionError::Internal(
"The date_trunc function can only accept timestamp as
the first arg.".to_string(),
))
}
```
--
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]