Skip to content

Commit

Permalink
ARROW-17412: [C++] AsofJoin multiple keys and types (apache#13880)
Browse files Browse the repository at this point in the history
See https://issues.apache.org/jira/browse/ARROW-17412

Lead-authored-by: Yaron Gvili <rtpsw@hotmail.com>
Co-authored-by: rtpsw <rtpsw@hotmail.com>
Signed-off-by: Weston Pace <weston.pace@gmail.com>
  • Loading branch information
rtpsw authored and zagto committed Oct 7, 2022
1 parent b480331 commit 8c2ce98
Show file tree
Hide file tree
Showing 9 changed files with 1,482 additions and 342 deletions.
15 changes: 8 additions & 7 deletions cpp/src/arrow/array/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ struct ARROW_EXPORT ArrayData {

std::shared_ptr<ArrayData> Copy() const { return std::make_shared<ArrayData>(*this); }

bool IsNull(int64_t i) const {
return ((buffers[0] != NULLPTR) ? !bit_util::GetBit(buffers[0]->data(), i + offset)
: null_count.load() == length);
}

// Access a buffer's data as a typed C pointer
template <typename T>
inline const T* GetValues(int i, int64_t absolute_offset) const {
Expand Down Expand Up @@ -324,18 +329,14 @@ struct ARROW_EXPORT ArraySpan {
return GetValues<T>(i, this->offset);
}

bool IsNull(int64_t i) const {
return ((this->buffers[0].data != NULLPTR)
? !bit_util::GetBit(this->buffers[0].data, i + this->offset)
: this->null_count == this->length);
}

bool IsValid(int64_t i) const {
inline bool IsValid(int64_t i) const {
return ((this->buffers[0].data != NULLPTR)
? bit_util::GetBit(this->buffers[0].data, i + this->offset)
: this->null_count != this->length);
}

inline bool IsNull(int64_t i) const { return !IsValid(i); }

std::shared_ptr<ArrayData> ToArrayData() const;

std::shared_ptr<Array> ToArray() const;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/exec/asof_join_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void TableJoinOverhead(benchmark::State& state,

static void AsOfJoinOverhead(benchmark::State& state) {
int64_t tolerance = 0;
AsofJoinNodeOptions options = AsofJoinNodeOptions(kTimeCol, kKeyCol, tolerance);
AsofJoinNodeOptions options = AsofJoinNodeOptions(kTimeCol, {kKeyCol}, tolerance);
TableJoinOverhead(
state,
TableGenerationProperties{int(state.range(0)), int(state.range(1)),
Expand Down
Loading

0 comments on commit 8c2ce98

Please sign in to comment.