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

Method PushValue

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

Source from the content-addressed store, hash-verified

216 pool, /*values_capacity=*/2 + static_cast<int64_t>(num_rows) * num_cols) {}
217
218 void PushValue(ParsedValueDesc v) {
219 DCHECK_LT(values_size_, values_capacity_);
220 values_[values_size_] = v;
221 // We must take care not to write past the buffer's end if the line being
222 // parsed has more than `num_cols` columns. The obvious solution of setting
223 // an error status hurts too much on benchmarks, which is why we instead
224 // cap `values_size_` to stay inside the buffer.
225 //
226 // Not setting an error immediately is not a problem since the `num_cols`
227 // mismatch is detected later in ParseLine.
228 //
229 // Note that we want `values_size_` to reflect the number of written values
230 // in the nominal case, which is why we choose a slightly larger `values_capacity_`.
231 values_size_ += (values_size_ != values_capacity_ - 1);
232 }
233};
234
235} // namespace

Callers 2

StartMethod · 0.45
FinishFieldMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected