| 50 | : BinaryViewBuilder(pool) {} |
| 51 | |
| 52 | Status BinaryViewBuilder::AppendArraySlice(const ArraySpan& array, int64_t offset, |
| 53 | int64_t length) { |
| 54 | auto bitmap = array.GetValues<uint8_t>(0, 0); |
| 55 | auto values = array.GetValues<BinaryViewType::c_type>(1) + offset; |
| 56 | |
| 57 | int64_t out_of_line_total = 0, i = 0; |
| 58 | VisitNullBitmapInline( |
| 59 | array.buffers[0].data, array.offset + offset, length, array.null_count, |
| 60 | [&] { |
| 61 | if (!values[i].is_inline()) { |
| 62 | out_of_line_total += static_cast<int64_t>(values[i].size()); |
| 63 | } |
| 64 | ++i; |
| 65 | }, |
| 66 | [&] { ++i; }); |
| 67 | |
| 68 | RETURN_NOT_OK(Reserve(length)); |
| 69 | RETURN_NOT_OK(ReserveData(out_of_line_total)); |
| 70 | |
| 71 | for (int64_t i = 0; i < length; i++) { |
| 72 | if (bitmap && !bit_util::GetBit(bitmap, array.offset + offset + i)) { |
| 73 | UnsafeAppendNull(); |
| 74 | continue; |
| 75 | } |
| 76 | |
| 77 | UnsafeAppend(util::FromBinaryView(values[i], array.GetVariadicBuffers().data())); |
| 78 | } |
| 79 | return Status::OK(); |
| 80 | } |
| 81 | |
| 82 | Status BinaryViewBuilder::FinishInternal(std::shared_ptr<ArrayData>* out) { |
| 83 | ARROW_ASSIGN_OR_RAISE(auto null_bitmap, null_bitmap_builder_.FinishWithLength(length_)); |
nothing calls this directly
no test coverage detected