gruuya opened a new pull request, #3038:
URL: https://github.com/apache/arrow-rs/pull/3038

   # Which issue does this PR close?
   
   Closes #3037 
   
   # Rationale for this change
    
   I'm working on adding support for [remote 
tables](https://github.com/splitgraph/seafowl/pull/190) in Seafowl (in analogy 
with PG FDWs) using the connector-x crate. An issue that comes up is the fact 
that connector-x uses arrow's Date64 as the target type for coercion of various 
datetime/timestamp types from other DBs.
   
   More specifically, Postgres TIMESTAMP [is converted 
into](https://github.com/sfu-db/connector-x/blob/9bc2bf455fd0a9ad3e8ff7834694fb317b497f4a/connectorx/src/transports/postgres_arrow.rs#L53)
 Date64. On the other hand, Datafusion 
[interprets](https://arrow.apache.org/datafusion/user-guide/sql/data_types.html#date-time-types)
 TIMESTAMP type as arrow's Timestamp(TimeUnit::Nanosecond, None). Consequently, 
I end up needing to cast from Date64 (as returned by connector-x) into 
Timestamp (as expected by Datafusion), but such cast is not supported at the 
moment.
   
   # What changes are included in this PR?
   
   I expanded the cast kernel to facilitate the Date64 -> Timestamp cast, as 
well as the `can_cast_types` function to reflect this.
   
   # Are there any user-facing changes?
   
   Trying to cast from Date64 to Timestamp will not error out after this; not 
sure whether this warrants a doc change somewhere.
   


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