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

Function AppendMapBatch

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

Source from the content-addressed store, hash-verified

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