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

Function SkipRows

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

Source from the content-addressed store, hash-verified

719int64_t BlockParser::first_row_num() const { return impl_->first_row_num(); }
720
721int32_t SkipRows(const uint8_t* data, uint32_t size, int32_t num_rows,
722 const uint8_t** out_data) {
723 const auto end = data + size;
724 int32_t skipped_rows = 0;
725 *out_data = data;
726
727 for (; skipped_rows < num_rows; ++skipped_rows) {
728 uint8_t c;
729 do {
730 while (ARROW_PREDICT_FALSE(data < end && !IsControlChar(*data))) {
731 ++data;
732 }
733 if (ARROW_PREDICT_FALSE(data == end)) {
734 return skipped_rows;
735 }
736 c = *data++;
737 } while (c != '\r' && c != '\n');
738 if (c == '\r' && data < end && *data == '\n') {
739 ++data;
740 }
741 *out_data = data;
742 }
743
744 return skipped_rows;
745}
746
747} // namespace csv
748} // namespace arrow

Callers 2

ProcessHeaderMethod · 0.85
CheckSkipRowsFunction · 0.85

Calls 1

IsControlCharFunction · 0.85

Tested by 1

CheckSkipRowsFunction · 0.68