You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "izveigor (via GitHub)" <gi...@apache.org> on 2023/03/10 19:37:45 UTC

[GitHub] [arrow-datafusion] izveigor commented on a diff in pull request #5550: feat: support type coercion for negative operator

izveigor commented on code in PR #5550:
URL: https://github.com/apache/arrow-datafusion/pull/5550#discussion_r1132805479


##########
datafusion/optimizer/src/type_coercion.rs:
##########
@@ -953,6 +967,18 @@ mod test {
         Ok(())
     }
 
+    #[test]
+    fn negative_for_type_coercion() -> Result<()> {
+        // negative
+        let expr = Expr::Negative(Box::new(col("a")));

Review Comment:
   It should be simplified by features in PR: https://github.com/apache/arrow-datafusion/pull/5511



##########
datafusion/optimizer/src/type_coercion.rs:
##########
@@ -165,6 +165,13 @@ impl ExprRewriter for TypeCoercionRewriter {
                     is_not_false(get_casted_expr_for_bool_op(&expr, &self.schema)?);
                 Ok(expr)
             }
+            Expr::Negative(expr) => {
+                let expr = Expr::Negative(Box::new(get_casted_expr_for_negative_op(

Review Comment:
   It should be simplified by features in PR: https://github.com/apache/arrow-datafusion/pull/5511



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