andygrove commented on code in PR #3396:
URL: https://github.com/apache/arrow-datafusion/pull/3396#discussion_r966004776


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -917,8 +898,16 @@ pub fn binary(
     rhs: Arc<dyn PhysicalExpr>,
     input_schema: &Schema,
 ) -> Result<Arc<dyn PhysicalExpr>> {
-    let (l, r) = binary_cast(lhs, &op, rhs, input_schema)?;
-    Ok(Arc::new(BinaryExpr::new(l, op, r)))
+    let lhs_type = &lhs.data_type(input_schema)?;
+    let rhs_type = &rhs.data_type(input_schema)?;
+    if !lhs_type.eq(rhs_type) {
+        return Err(DataFusionError::Internal(format!(
+            "The left type {} and right type {} of binary physical expr should 
be same",
+            lhs_type, rhs_type
+        )));
+    }
+    // let (l, r) = binary_cast(lhs, &op, rhs, input_schema)?;

Review Comment:
   ```suggestion
   ```



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