Skip to content

Commit

Permalink
Fix and UT
Browse files Browse the repository at this point in the history
  • Loading branch information
zanmato1984 committed Feb 10, 2025
1 parent e32f56b commit fa43cd6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpp/src/arrow/compute/row/encode_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ void EncoderInteger::Decode(uint32_t start_row, uint32_t num_rows,
case 4:
for (uint32_t i = 0; i < num_rows; ++i) {
reinterpret_cast<uint32_t*>(col_base)[i] = *reinterpret_cast<const uint32_t*>(
// rows.fixed_length_rows(start_row + i) + offset_within_row);
rows.fixed_length_rows(start_row + i + offset_within_row));
}
break;
Expand Down
22 changes: 22 additions & 0 deletions cpp/src/arrow/compute/row/grouper_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,28 @@ TEST(Grouper, DictKey) {
g.grouper_->Consume(dict_span));
}

TEST(Grouper, MultipleIntKeys) {
// auto types = NumericTypes();
auto types = {int8(), int16(), int32(), int64()};
for (auto& t0 : types) {
ARROW_SCOPED_TRACE("t0=", t0->ToString());
for (auto& t1 : types) {
ARROW_SCOPED_TRACE("t1=", t1->ToString());
for (auto& t2 : types) {
ARROW_SCOPED_TRACE("t2=", t2->ToString());
TestGrouper g({t0, t1, t2});

g.ExpectConsume(R"([[0, 1, 2], [0, 1, 2]])", "[0, 0]");
g.ExpectConsume(R"([[0, 1, 2], [null, 1, 2]])", "[0, 1]");
g.ExpectConsume(R"([[0, 1, 2], [0, null, 2]])", "[0, 2]");
g.ExpectConsume(R"([[0, 1, 2], [0, 1, null]])", "[0, 3]");

g.ExpectUniques("[[0, 1, 2], [null, 1, 2], [0, null, 2], [0, 1, null]]");
}
}
}
}

TEST(Grouper, StringInt64Key) {
TestGrouper g({utf8(), int64()});

Expand Down

0 comments on commit fa43cd6

Please sign in to comment.