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/08 20:05:26 UTC

[GitHub] [arrow-datafusion] izveigor commented on a diff in pull request #5516: feat: add the similar optimization function for bitwise negative

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


##########
datafusion/optimizer/src/simplify_expressions/utils.rs:
##########
@@ -311,6 +311,38 @@ pub fn negate_clause(expr: Expr) -> Expr {
     }
 }
 
+/// bitwise negate a Negative clause
+/// input is the clause to be bitwise negated.(args for Negative clause)
+/// For BinaryExpr:
+///    ~(A & B) ===> ~A | ~B
+///    ~(A | B) ===> ~A & ~B
+///    ~(~A) ===> A
+/// For others, use Negative clause
+pub fn negative_clause(expr: Expr) -> Expr {

Review Comment:
   I think, it deserves a better name.



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