@@ -144,7 +144,9 @@ class UnPooledBooleanBuilder : public EmptyBuilder {
144144 }
145145
146146 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
147- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
147+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
148+ this ->UnsafeAppendToBitmap (valid_bytes, length);
149+ return arrow::Status::OK ();
148150 }
149151
150152 arrow::Status SetData (const uint8_t * data, int64_t length) {
@@ -189,7 +191,9 @@ class UnPooledPrimitiveBuilder : public arrow::NumericBuilder<Type> {
189191 }
190192
191193 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
192- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
194+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
195+ this ->UnsafeAppendToBitmap (valid_bytes, length);
196+ return arrow::Status::OK ();
193197 }
194198
195199 arrow::Status FinishInternal (std::shared_ptr<arrow::ArrayData>* out) override {
@@ -230,7 +234,9 @@ class UnPooledLargeBinaryBuilder : public arrow::LargeBinaryBuilder {
230234 length_ += length;
231235 }
232236 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
233- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
237+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
238+ this ->UnsafeAppendToBitmap (valid_bytes, length);
239+ return arrow::Status::OK ();
234240 }
235241 arrow::Status FinishInternal (std::shared_ptr<arrow::ArrayData>* out) override {
236242 std::shared_ptr<arrow::Buffer> null_bitmap;
@@ -275,7 +281,9 @@ class UnPooledBinaryBuilder : public arrow::BinaryBuilder {
275281 }
276282
277283 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
278- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
284+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
285+ this ->UnsafeAppendToBitmap (valid_bytes, length);
286+ return arrow::Status::OK ();
279287 }
280288
281289 arrow::Status FinishInternal (std::shared_ptr<arrow::ArrayData>* out) override {
@@ -315,7 +323,9 @@ class UnPooledListBuilder : public EmptyBuilder {
315323 }
316324
317325 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
318- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
326+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
327+ this ->UnsafeAppendToBitmap (valid_bytes, length);
328+ return arrow::Status::OK ();
319329 }
320330
321331 void SetOffsets (const std::shared_ptr<arrow::Buffer>& offsets) {
@@ -363,7 +373,9 @@ class UnPooledStructBuilder : public EmptyBuilder {
363373 }
364374
365375 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
366- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
376+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
377+ this ->UnsafeAppendToBitmap (valid_bytes, length);
378+ return arrow::Status::OK ();
367379 }
368380
369381 arrow::Status FinishInternal (std::shared_ptr<arrow::ArrayData>* out) override {
@@ -489,7 +501,9 @@ class UnPooledStringDictionaryBuilder : public EmptyBuilder {
489501 indices_ = indices;
490502 }
491503 arrow::Status SetNulls (const uint8_t * valid_bytes, int64_t length) {
492- return arrow::ArrayBuilder::AppendToBitmap (valid_bytes, length);
504+ ARROW_RETURN_NOT_OK (this ->Reserve (length));
505+ this ->UnsafeAppendToBitmap (valid_bytes, length);
506+ return arrow::Status::OK ();
493507 }
494508 arrow::Status FinishInternal (std::shared_ptr<arrow::ArrayData>* out) override {
495509 std::shared_ptr<arrow::Buffer> null_bitmap;
0 commit comments