larry98 commented on code in PR #43256:
URL: https://github.com/apache/arrow/pull/43256#discussion_r1690428460


##########
cpp/src/arrow/compute/expression.cc:
##########
@@ -1242,33 +1242,104 @@ struct Inequality {
                             /*insert_implicit_casts=*/false, &exec_context);
   }
 
+  /// Simplify an is_in predicate against this inequality as a guarantee.
+  Result<Expression> SimplifyIsIn(Expression expr) {
+    const auto& guarantee = *this;
+    auto call = expr.call();
+    auto options = checked_pointer_cast<SetLookupOptions>(call->options);
+
+    auto value_set = options->value_set.make_array();
+    if (!value_set) return expr;
+    if (value_set->length() == 0) return literal(false);

Review Comment:
   I changed it so that everything is guarded by the `guarantee.nullable` check.



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