Skip to content

Commit 32fdb8f

Browse files
committed
[ARROw-6073] Reset Decimal128Builder in Finish().
This change updates the FinishInternal implementation in Decimal128Builder to reset the internal state at finish time.
1 parent e806f2f commit 32fdb8f

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

cpp/src/arrow/array-test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,7 @@ class DecimalTest : public ::testing::TestWithParam<int> {
17551755

17561756
std::shared_ptr<Array> out;
17571757
FinishAndCheckPadding(builder.get(), &out);
1758+
ASSERT_EQ(builder->length(), 0);
17581759

17591760
std::vector<uint8_t> raw_bytes;
17601761

cpp/src/arrow/array/builder_decimal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Status Decimal128Builder::FinishInternal(std::shared_ptr<ArrayData>* out) {
6969
RETURN_NOT_OK(null_bitmap_builder_.Finish(&null_bitmap));
7070

7171
*out = ArrayData::Make(type_, length_, {null_bitmap, data}, null_count_);
72-
72+
capacity_ = length_ = null_count_ = 0;
7373
return Status::OK();
7474
}
7575

0 commit comments

Comments
 (0)