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

Method Insert

cpp/src/arrow/json/chunked_builder.cc:207–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205 }
206
207 void Insert(int64_t block_index, const std::shared_ptr<Field>&,
208 const std::shared_ptr<Array>& unconverted) override {
209 std::unique_lock<std::mutex> lock(mutex_);
210
211 if (null_bitmap_chunks_.size() <= static_cast<size_t>(block_index)) {
212 null_bitmap_chunks_.resize(static_cast<size_t>(block_index) + 1, nullptr);
213 offset_chunks_.resize(null_bitmap_chunks_.size(), nullptr);
214 }
215
216 if (unconverted->type_id() == Type::NA) {
217 auto st = InsertNull(block_index, unconverted->length());
218 if (!st.ok()) {
219 task_group_->Append([st] { return st; });
220 }
221 return;
222 }
223
224 DCHECK_EQ(unconverted->type_id(), Type::LIST);
225 const auto& list_array = checked_cast<const ListArray&>(*unconverted);
226
227 null_bitmap_chunks_[block_index] = unconverted->null_bitmap();
228 offset_chunks_[block_index] = list_array.value_offsets();
229
230 value_builder_->Insert(block_index, list_array.list_type()->value_field(),
231 list_array.values());
232 }
233
234 Status Finish(std::shared_ptr<ChunkedArray>* out) override {
235 RETURN_NOT_OK(task_group_->Finish());

Callers 9

ParseAndInsertMethod · 0.45
operator()Method · 0.45
ParseOneFunction · 0.45
InsertNullMethod · 0.45
InsertMethod · 0.45
FinishMethod · 0.45
InsertChildrenMethod · 0.45
AssertBuildingFunction · 0.45
TESTFunction · 0.45

Calls 9

resizeMethod · 0.80
value_offsetsMethod · 0.80
sizeMethod · 0.45
type_idMethod · 0.45
lengthMethod · 0.45
okMethod · 0.45
AppendMethod · 0.45
list_typeMethod · 0.45
valuesMethod · 0.45

Tested by 2

AssertBuildingFunction · 0.36
TESTFunction · 0.36