Weijun-H commented on PR #5818:
URL: 
https://github.com/apache/arrow-datafusion/pull/5818#issuecomment-1499640854

   > @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(),
   >                 ))
   >             }
   > ```
   
   It seems that we should modify the function signature, like
   ```
   date_trunc('Timestamp(Second, None)', to_timestamp_seconds(61))?
   ```


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

Reply via email to