R-JunmingChen commented on code in PR #36739:
URL: https://github.com/apache/arrow/pull/36739#discussion_r1309501211
##########
cpp/src/arrow/compute/api_scalar.h:
##########
@@ -268,19 +268,43 @@ class ARROW_EXPORT ExtractRegexOptions : public
FunctionOptions {
/// Options for IsIn and IndexIn functions
class ARROW_EXPORT SetLookupOptions : public FunctionOptions {
public:
- explicit SetLookupOptions(Datum value_set, bool skip_nulls = false);
+ enum NullMatchingBehavior { MATCH, SKIP, EMIT_NULL, INCONCLUSIVE };
+
+ explicit SetLookupOptions(Datum value_set, NullMatchingBehavior = MATCH);
+ // DEPRECATED(will be removed after removing of skip_nulls)
+ explicit SetLookupOptions(Datum value_set, bool skip_nulls);
SetLookupOptions();
static constexpr char const kTypeName[] = "SetLookupOptions";
/// The set of values to look up input values into.
Datum value_set;
+
+ /// How to match null values.
+ ///
+ /// Match, any null in `value_set` is successfully matched in
+ /// the input.
+ /// SKIP, any null in `value_set` is ignored and nulls in the input
+ /// produce null (IndexIn) or false (IsIn) values in the output.
+ /// EMIT_NULL, any null in `value_set` is ignored and nulls in the
+ /// input produce null (IndexIn and IsIn) values in the output.
+ /// INCONCLUSIVE, null values are regard as unknown values, which is
+ /// sql-compatible. nulls in the input produce null (IndexIn and IsIn)
+ /// values in the output. Besides, if `value_set` contains a null,
+ /// non-null unmatched values in the input also produce null values
+ /// (IndexIn and IsIn) in the output.
+ NullMatchingBehavior null_matching_behavior;
+
+ // DEPRECATED(will be removed after removing of skip_nulls)
Review Comment:
No, since `skip_nulls` can be set via its member variable like this.
```
SetLookupOptions option(value_set);
option.skip_nulls = true;
```
The `null_matching_behavior` set in the constructor has a possibility to
contradict with `skip_nulls`. To support backward compatibility, we should
assign `skip_nulls` with a higher priority.
--
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]