diff --git a/cpp/src/arrow/compute/api_scalar.cc b/cpp/src/arrow/compute/api_scalar.cc index 01f705f7f84c1..76707cf143c3b 100644 --- a/cpp/src/arrow/compute/api_scalar.cc +++ b/cpp/src/arrow/compute/api_scalar.cc @@ -564,13 +564,7 @@ constexpr char RoundToMultipleOptions::kTypeName[]; SetLookupOptions::SetLookupOptions(Datum value_set, bool skip_nulls) : FunctionOptions(internal::kSetLookupOptionsType), value_set(std::move(value_set)), - skip_nulls(skip_nulls) { - if (skip_nulls) { - this->null_matching_behavior = SetLookupOptions::SKIP; - } else { - this->null_matching_behavior = SetLookupOptions::MATCH; - } -} + skip_nulls(std::move(skip_nulls)) {} SetLookupOptions::SetLookupOptions( Datum value_set, SetLookupOptions::NullMatchingBehavior null_matching_behavior) : FunctionOptions(internal::kSetLookupOptionsType), @@ -578,7 +572,7 @@ SetLookupOptions::SetLookupOptions( null_matching_behavior(std::move(null_matching_behavior)) {} SetLookupOptions::SetLookupOptions() : SetLookupOptions({}, SetLookupOptions::NullMatchingBehavior::MATCH) {} -SetLookupOptions::NullMatchingBehavior SetLookupOptions::getNullMatchingBehavior() const { +SetLookupOptions::NullMatchingBehavior SetLookupOptions::GetNullMatchingBehavior() const { if (!this->skip_nulls.has_value()) { return this->null_matching_behavior; } else if (this->skip_nulls.value()) { diff --git a/cpp/src/arrow/compute/api_scalar.h b/cpp/src/arrow/compute/api_scalar.h index 8714d4a245530..7391f12bd6b4e 100644 --- a/cpp/src/arrow/compute/api_scalar.h +++ b/cpp/src/arrow/compute/api_scalar.h @@ -295,7 +295,7 @@ class ARROW_EXPORT SetLookupOptions : public FunctionOptions { NullMatchingBehavior null_matching_behavior; // DEPRECATED(will be removed after removing of skip_nulls) - NullMatchingBehavior getNullMatchingBehavior() const; + NullMatchingBehavior GetNullMatchingBehavior() const; // DEPRECATED(use null_matching_behavior instead) /// Whether nulls in `value_set` count for lookup. diff --git a/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc b/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc index d5cf258a267f5..dd6fdc0212db7 100644 --- a/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc +++ b/cpp/src/arrow/compute/kernels/scalar_set_lookup.cc @@ -44,7 +44,7 @@ struct SetLookupState : public SetLookupStateBase { explicit SetLookupState(MemoryPool* pool) : memory_pool(pool) {} Status Init(const SetLookupOptions& options) { - this->null_matching_behavior = options.getNullMatchingBehavior(); + this->null_matching_behavior = options.GetNullMatchingBehavior(); if (options.value_set.is_array()) { const ArrayData& value_set = *options.value_set.array(); memo_index_to_value_index.reserve(value_set.length); @@ -127,7 +127,7 @@ struct SetLookupState : public SetLookupStateBase { explicit SetLookupState(MemoryPool*) {} Status Init(SetLookupOptions& options) { - null_matching_behavior = options.getNullMatchingBehavior(); + null_matching_behavior = options.GetNullMatchingBehavior(); value_set_has_null = (options.value_set.length() > 0) && this->null_matching_behavior != SetLookupOptions::SKIP; value_set_type = null();