You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "comphead (via GitHub)" <gi...@apache.org> on 2023/04/07 16:32:09 UTC

[GitHub] [arrow-datafusion] comphead commented on a diff in pull request #5902: feat: Implement the bitwise_not in NotExpr

comphead commented on code in PR #5902:
URL: https://github.com/apache/arrow-datafusion/pull/5902#discussion_r1160815036


##########
datafusion/core/tests/sql/expr.rs:
##########
@@ -622,6 +622,17 @@ async fn test_not_expressions() -> Result<()> {
     ];
     assert_batches_eq!(expected, &actual);
 
+    let sql = "SELECT not(1), not(0)";
+    let actual = execute_to_batches(&ctx, sql).await;

Review Comment:
   maybe lets move it to `scalar.slt` sqllogic test?



##########
datafusion/physical-expr/src/expressions/not.rs:
##########
@@ -59,8 +63,25 @@ impl PhysicalExpr for NotExpr {
         self
     }
 
-    fn data_type(&self, _input_schema: &Schema) -> Result<DataType> {
-        Ok(DataType::Boolean)
+    fn data_type(&self, input_schema: &Schema) -> Result<DataType> {
+        // Ok(DataType::Boolean)
+        let data_type = self.arg.data_type(input_schema)?;

Review Comment:
   That looks breaking imho... I would propose to have the own `BitwiseNotExpr` instead of making `NotExpr` universal



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