Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
R-JunmingChen committed Aug 29, 2023
1 parent bba645b commit e2aa28a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions cpp/src/arrow/compute/api_scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,21 +564,15 @@ 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),
value_set(std::move(value_set)),
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()) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/api_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -127,7 +127,7 @@ struct SetLookupState<NullType> : 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();
Expand Down

0 comments on commit e2aa28a

Please sign in to comment.