You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/13 22:22:53 UTC

[GitHub] [arrow] seddonm1 commented on a change in pull request #10005: ARROW-12232: [Rust][DataFusion] Add SQL support for CAST(.. AS Time) millisecond

seddonm1 commented on a change in pull request #10005:
URL: https://github.com/apache/arrow/pull/10005#discussion_r612813368



##########
File path: rust/datafusion/src/sql/planner.rs
##########
@@ -1498,6 +1498,7 @@ pub fn convert_data_type(sql: &SQLDataType) -> Result<DataType> {
         SQLDataType::Double => Ok(DataType::Float64),
         SQLDataType::Char(_) | SQLDataType::Varchar(_) => Ok(DataType::Utf8),
         SQLDataType::Timestamp => Ok(DataType::Timestamp(TimeUnit::Nanosecond, None)),
+        SQLDataType::Time => Ok(DataType::Timestamp(TimeUnit::Millisecond, None)),

Review comment:
       @alamb I am not a fan of trying to invent functions that are not in the SQL spec: i.e. `select arrow_cast(my_col, 'Timestamp(Milliseconds, None)'`.
   
   My vote goes to implement the Postgres functions above.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org