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

Method Insert

cpp/src/arrow/csv/column_builder.cc:148–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146};
147
148void NullColumnBuilder::Insert(int64_t block_index,
149 const std::shared_ptr<BlockParser>& parser) {
150 ReserveChunks(block_index);
151
152 // Spawn a task that will build an array of nulls with the right DataType
153 const int32_t num_rows = parser->num_rows();
154 DCHECK_GE(num_rows, 0);
155
156 // `self` keeps us alive, `this` allows easy access to derived / protected member vars
157 task_group_->Append(
158 [self = shared_from_this(), this, block_index, num_rows]() -> Status {
159 std::unique_ptr<ArrayBuilder> builder;
160 RETURN_NOT_OK(MakeBuilder(pool_, type_, &builder));
161 std::shared_ptr<Array> res;
162 RETURN_NOT_OK(builder->AppendNulls(num_rows));
163 RETURN_NOT_OK(builder->Finish(&res));
164
165 return SetChunk(block_index, res);
166 });
167}
168
169//////////////////////////////////////////////////////////////////////////
170// Pre-typed column builder implementation

Callers 2

ProcessDataMethod · 0.45
TEST_FFunction · 0.45

Calls 8

resizeMethod · 0.80
MakeBuilderFunction · 0.50
num_rowsMethod · 0.45
AppendMethod · 0.45
AppendNullsMethod · 0.45
FinishMethod · 0.45
ConvertMethod · 0.45
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.36