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


##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -147,16 +150,16 @@ 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:
   We can't match this condition (interval - date) because it will continue 
match.
   
   So we should match them, and add judge check.



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