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

Method ProcessSkip

cpp/src/arrow/util/delimiting.cc:172–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172Status Chunker::ProcessSkip(std::shared_ptr<Buffer> partial,
173 std::shared_ptr<Buffer> block, bool final, int64_t* count,
174 std::shared_ptr<Buffer>* rest) {
175 DCHECK_GT(*count, 0);
176 int64_t pos;
177 int64_t num_found;
178 ARROW_RETURN_NOT_OK(boundary_finder_->FindNth(
179 std::string_view(*partial), std::string_view(*block), *count, &pos, &num_found));
180 if (pos == BoundaryFinder::kNoDelimiterFound) {
181 return StraddlingTooLarge();
182 }
183 if (ARROW_PREDICT_FALSE(final && *count > num_found && block->size() != pos)) {
184 // Skip the last row in the final block which does not have a delimiter
185 ++num_found;
186 *rest = SliceBuffer(std::move(block), 0, 0);
187 } else {
188 *rest = SliceBuffer(std::move(block), pos);
189 }
190 *count -= num_found;
191 return Status::OK();
192}
193
194} // namespace arrow

Callers 3

AssertSkipMethod · 0.80
operator()Method · 0.80
operator()Method · 0.80

Calls 5

StraddlingTooLargeFunction · 0.85
SliceBufferFunction · 0.85
OKFunction · 0.50
FindNthMethod · 0.45
sizeMethod · 0.45

Tested by 1

AssertSkipMethod · 0.64