You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jackwener (via GitHub)" <gi...@apache.org> on 2023/05/01 09:28:00 UTC

[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6177: fix: type coercion ignore Date - Interval

jackwener commented on code in PR #6177:
URL: https://github.com/apache/arrow-datafusion/pull/6177#discussion_r1181482071


##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -147,14 +150,12 @@ pub fn coerce_types(
         | Operator::IsNotDistinctFrom => comparison_coercion(lhs_type, rhs_type),
         // interval - timestamp is an erroneous case, cannot coerce a type
         Operator::Plus | Operator::Minus
-            if (is_date(lhs_type)
-                || is_date(rhs_type)
-                || is_timestamp(lhs_type)
-                || is_timestamp(rhs_type)
+            if (is_datetime(lhs_type)
+                || is_datetime(rhs_type)
                 || is_interval(lhs_type)
                 || is_interval(rhs_type))
                 && (!is_interval(lhs_type)
-                    || !is_timestamp(rhs_type)

Review Comment:
   Here don't consider `DateType`



-- 
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: github-unsubscribe@arrow.apache.org

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