| 731 | |
| 732 | template <class ArrayType> |
| 733 | Status WriteListBatch(const Array& array, int64_t orc_offset, |
| 734 | liborc::ColumnVectorBatch* column_vector_batch) { |
| 735 | const ArrayType& list_array(checked_cast<const ArrayType&>(array)); |
| 736 | auto batch = checked_cast<liborc::ListVectorBatch*>(column_vector_batch); |
| 737 | liborc::ColumnVectorBatch* element_batch = (batch->elements).get(); |
| 738 | int64_t arrow_length = array.length(); |
| 739 | int64_t running_arrow_offset = 0, running_orc_offset = orc_offset; |
| 740 | if (orc_offset == 0) { |
| 741 | batch->offsets[0] = 0; |
| 742 | } |
| 743 | if (array.null_count()) { |
| 744 | batch->hasNulls = true; |
| 745 | } |
| 746 | for (; running_arrow_offset < arrow_length; |
| 747 | running_orc_offset++, running_arrow_offset++) { |
| 748 | if (array.IsNull(running_arrow_offset)) { |
| 749 | batch->notNull[running_orc_offset] = false; |
| 750 | batch->offsets[running_orc_offset + 1] = batch->offsets[running_orc_offset]; |
| 751 | } else { |
| 752 | batch->notNull[running_orc_offset] = true; |
| 753 | batch->offsets[running_orc_offset + 1] = |
| 754 | batch->offsets[running_orc_offset] + |
| 755 | list_array.value_offset(running_arrow_offset + 1) - |
| 756 | list_array.value_offset(running_arrow_offset); |
| 757 | element_batch->resize(batch->offsets[running_orc_offset + 1]); |
| 758 | int64_t subarray_arrow_offset = list_array.value_offset(running_arrow_offset), |
| 759 | subarray_orc_offset = batch->offsets[running_orc_offset], |
| 760 | subarray_orc_length = |
| 761 | batch->offsets[running_orc_offset + 1] - subarray_orc_offset; |
| 762 | RETURN_NOT_OK(WriteBatch( |
| 763 | *(list_array.values()->Slice(subarray_arrow_offset, subarray_orc_length)), |
| 764 | subarray_orc_offset, element_batch)); |
| 765 | } |
| 766 | } |
| 767 | return Status::OK(); |
| 768 | } |
| 769 | |
| 770 | Status WriteMapBatch(const Array& array, int64_t orc_offset, |
| 771 | liborc::ColumnVectorBatch* column_vector_batch) { |
nothing calls this directly
no test coverage detected