milevin commented on code in PR #13741:
URL: https://github.com/apache/datafusion/pull/13741#discussion_r1881600889


##########
datafusion/expr-common/src/type_coercion/binary.rs:
##########
@@ -1607,6 +1629,18 @@ mod tests {
         }};
     }
 
+    /// Test coercion rules for assymetric binary operators
+    ///
+    /// Applies coercion rules for `$LHS_TYPE $OP $RHS_TYPE` and asserts that 
the
+    /// the result types are `$RESULT_TYPE1` and `$RESULT_TYPE2` respectively
+    macro_rules! test_coercion_assymetric_binary_rule {
+        ($LHS_TYPE:expr, $RHS_TYPE:expr, $OP:expr, $RESULT_TYPE1:expr, 
$RESULT_TYPE2:expr) => {{
+            let (lhs, rhs) = get_input_types(&$LHS_TYPE, &$OP, &$RHS_TYPE)?;
+            assert_eq!(lhs, $RESULT_TYPE1);
+            assert_eq!(rhs, $RESULT_TYPE2);

Review Comment:
   The operator is symmetric, but how we cast the left and right types is not 
symmetric. Hence I needed an assymetric test for this.



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to