larry98 commented on code in PR #43256:
URL: https://github.com/apache/arrow/pull/43256#discussion_r1722187956
##########
cpp/src/arrow/compute/expression_test.cc:
##########
@@ -1616,6 +1616,70 @@ TEST(Expression,
SimplifyWithComparisonAndNullableCaveat) {
true_unless_null(field_ref("i32")))); // not satisfiable, will drop
row group
}
+TEST(Expression, SimplifyIsIn) {
+ auto is_in = [](Expression field, std::shared_ptr<DataType> value_set_type,
+ std::string json_array) {
+ SetLookupOptions options{ArrayFromJSON(value_set_type, json_array),
+ SetLookupOptions::MATCH};
+ return call("is_in", {field}, options);
+ };
+
+ Simplify{is_in(field_ref("i32"), int32(), "[]")}
+ .WithGuarantee(greater(field_ref("i32"), literal(2)))
+ .Expect(false);
+
+ Simplify{is_in(field_ref("i32"), int32(), "[null]")}
+ .WithGuarantee(greater(field_ref("i32"), literal(2)))
+ .Expect(false);
Review Comment:
Not sure if I follow, the guarantee `i32 > 2` itself guarantees that `i32`
is non-null.
--
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]