| 105 | } |
| 106 | |
| 107 | Status AppendMapBatch(const liborc::Type* type, |
| 108 | liborc::ColumnVectorBatch* column_vector_batch, int64_t offset, |
| 109 | int64_t length, ArrayBuilder* abuilder) { |
| 110 | auto builder = checked_cast<MapBuilder*>(abuilder); |
| 111 | auto batch = checked_cast<liborc::MapVectorBatch*>(column_vector_batch); |
| 112 | liborc::ColumnVectorBatch* keys = batch->keys.get(); |
| 113 | liborc::ColumnVectorBatch* items = batch->elements.get(); |
| 114 | const liborc::Type* key_type = type->getSubtype(0); |
| 115 | const liborc::Type* item_type = type->getSubtype(1); |
| 116 | |
| 117 | const bool has_nulls = batch->hasNulls; |
| 118 | for (int64_t i = offset; i < length + offset; i++) { |
| 119 | if (!has_nulls || batch->notNull[i]) { |
| 120 | int64_t start = batch->offsets[i]; |
| 121 | int64_t end = batch->offsets[i + 1]; |
| 122 | RETURN_NOT_OK(builder->Append()); |
| 123 | RETURN_NOT_OK( |
| 124 | AppendBatch(key_type, keys, start, end - start, builder->key_builder())); |
| 125 | RETURN_NOT_OK( |
| 126 | AppendBatch(item_type, items, start, end - start, builder->item_builder())); |
| 127 | } else { |
| 128 | RETURN_NOT_OK(builder->AppendNull()); |
| 129 | } |
| 130 | } |
| 131 | return Status::OK(); |
| 132 | } |
| 133 | |
| 134 | template <class BuilderType, class BatchType, class ElemType> |
| 135 | Status AppendNumericBatch(liborc::ColumnVectorBatch* column_vector_batch, int64_t offset, |
no test coverage detected