andre-cc-natzka opened a new pull request, #4312: URL: https://github.com/apache/arrow-datafusion/pull/4312
# Which issue does this PR close? Closes [#431](https://github.com/apache/arrow-datafusion/issues/4311. # Rationale for this change Currently DataFusion supports type coercion for (`DataType::Time`, `DataType::Utf8`) and (`DataType::Date`, `DataType::Utf8`) pairs, but is still missing type coercion for (`DataType::Timestamp`, `DataType::Utf8`). # What changes are included in this PR? Two lines of code are added in the `temporal_coercion` function to account for type coercion for a (`DataType::Timestamp`, `DataType::Utf8`) pair. The output type is `DataType::Timestamp(TimeUnit::Nanosecond, _)`, because it is the only time unit supported by Arrow, which forces us to change the original time unit to nanoseconds. Although not ideal, this is not a problem, as both the left and right hand side of an expression are converted into `DataType::Timestamp(TimeUnit::Nanosecond, _)` and the expression can be properly evaluated. # Are these changes tested? Yes, corresponding test cases are added to the test function `test_type_coercion` from `datafusion/expr/src/type_coercion/binary.rs`. # Are there any user-facing changes? No. -- 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]
