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/04 09:01:58 UTC

[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6221: refactor: separate get_result_type from `coerce_type`

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


##########
datafusion/expr/src/type_coercion/binary.rs:
##########
@@ -106,6 +106,55 @@ pub fn binary_operator_data_type(
     }
 }
 
+pub fn get_result_type(
+    lhs_type: &DataType,
+    op: &Operator,
+    rhs_type: &DataType,
+) -> Result<DataType> {
+    let result = match op {
+        Operator::And
+        | Operator::Or
+        | Operator::Eq
+        | Operator::NotEq
+        | Operator::Lt
+        | Operator::Gt
+        | Operator::GtEq
+        | Operator::LtEq
+        | Operator::IsDistinctFrom

Review Comment:
   Original, even if when we call `get_data_type`, it will return common type instead of `Boolean` in `coerce_type`. So original it's wrong.



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