| 597 | } |
| 598 | |
| 599 | Status Write() { |
| 600 | if (values.type_id() == Type::DICTIONARY) { |
| 601 | return WriteArrayV1(*(checked_cast<const DictionaryArray&>(values).indices()), dst, |
| 602 | meta); |
| 603 | } |
| 604 | |
| 605 | ARROW_ASSIGN_OR_RAISE(meta->type, ToFlatbufferType(*values.type())); |
| 606 | ARROW_ASSIGN_OR_RAISE(meta->offset, dst->Tell()); |
| 607 | meta->length = values.length(); |
| 608 | meta->null_count = values.null_count(); |
| 609 | meta->total_bytes = 0; |
| 610 | |
| 611 | // Write the null bitmask |
| 612 | if (values.null_count() > 0) { |
| 613 | RETURN_NOT_OK(WriteBuffer(values.null_bitmap_data(), |
| 614 | bit_util::BytesForBits(values.length()), |
| 615 | values.offset())); |
| 616 | } |
| 617 | // Write data buffer(s) |
| 618 | return VisitTypeInline(*values.type(), this); |
| 619 | } |
| 620 | }; |
| 621 | |
| 622 | Status WriteArrayV1(const Array& values, io::OutputStream* dst, ArrayMetadata* meta) { |
no test coverage detected