viirya commented on code in PR #2809:
URL: https://github.com/apache/arrow-datafusion/pull/2809#discussion_r912441168


##########
datafusion/physical-expr/src/expressions/in_list.rs:
##########
@@ -532,66 +521,131 @@ impl PhysicalExpr for InListExpr {
             match value_data_type {
                 DataType::Boolean => {
                     let array = 
array.as_any().downcast_ref::<BooleanArray>().unwrap();
-                    set_contains_with_negated!(array, set, self.negated)
+                    Ok(set_contains_for_primitive!(

Review Comment:
   I'm wondering why `set_contains_for_primitive` is macro, but 
`set_contains_utf` and `make_set_contains_decimal` are methods?



##########
datafusion/physical-expr/src/expressions/in_list.rs:
##########
@@ -363,25 +349,28 @@ fn make_set_contains_decimal(
         .collect::<Vec<_>>();
     let native_set: HashSet<i128> = HashSet::from_iter(native_array);
 
-    if !negated {
-        // In
-        array
-            .iter()
-            .map(|v| v.map(|v128| native_set.contains(&v128)))
-            .collect::<BooleanArray>()
-    } else {
-        // Not in
-        if contains_null {
-            // If the expr is NOT IN and the list contains NULL value
-            // All the result must be NONE
-            BooleanArray::from(vec![None; array.len()])
-        } else {
-            array
-                .iter()
-                .map(|v| v.map(|v128| !native_set.contains(&v128)))
-                .collect::<BooleanArray>()
-        }
-    }
+    collection_contains_check!(array, native_set, negated, contains_null)
+}
+
+fn set_contains_utf<OffsetSize: OffsetSizeTrait>(

Review Comment:
   ```suggestion
   fn make_set_contains_utf8<OffsetSize: OffsetSizeTrait>(
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to