MCPcopy Create free account
hub / github.com/apache/arrow / AppendMapBatch

Function AppendMapBatch

cpp/src/arrow/adapters/orc/util.cc:107–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107Status 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
134template <class BuilderType, class BatchType, class ElemType>
135Status AppendNumericBatch(liborc::ColumnVectorBatch* column_vector_batch, int64_t offset,

Callers 1

AppendBatchFunction · 0.85

Calls 5

AppendBatchFunction · 0.85
OKFunction · 0.50
getMethod · 0.45
AppendMethod · 0.45
AppendNullMethod · 0.45

Tested by

no test coverage detected