You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/08 13:56:52 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #3396: remove type coercion in the binary physical expr

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

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