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