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

Method PushValue

cpp/src/arrow/csv/parser.cc:185–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 : ValueDescWriter(pool, /*values_capacity=*/256) {}
184
185 void PushValue(ParsedValueDesc v) {
186 if (ARROW_PREDICT_FALSE(values_size_ == values_capacity_)) {
187 int64_t new_capacity = values_capacity_ * 2;
188 auto resize_status = values_buffer_->Resize(new_capacity * sizeof(*values_));
189 if (resize_status.ok()) {
190 values_ = reinterpret_cast<ParsedValueDesc*>(values_buffer_->mutable_data());
191 values_capacity_ = new_capacity;
192 }
193 status_ &= std::move(resize_status);
194 }
195 // The `values_` pointer may have become invalid if the `Resize` call above failed.
196 // Note that ResizableValueDescWriter is less performance-critical than
197 // PresizedValueDescWriter, as it should only be called on the first line(s)
198 // of CSV data.
199 if (ARROW_PREDICT_TRUE(status_.ok())) {
200 values_[values_size_++] = v;
201 }
202 }
203};
204
205// A helper class allocating the buffer for values offsets and writing into it

Callers

nothing calls this directly

Calls 3

ResizeMethod · 0.45
okMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected