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

Method PushValue

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

Source from the content-addressed store, hash-verified

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

Callers 2

StartMethod · 0.45
FinishFieldMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected