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

Function SkipRows

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

Source from the content-addressed store, hash-verified

731int64_t BlockParser::first_row_num() const { return impl_->first_row_num(); }
732
733int32_t SkipRows(const uint8_t* data, uint32_t size, int32_t num_rows,
734 const uint8_t** out_data) {
735 const auto end = data + size;
736 int32_t skipped_rows = 0;
737 *out_data = data;
738
739 for (; skipped_rows < num_rows; ++skipped_rows) {
740 uint8_t c;
741 do {
742 while (ARROW_PREDICT_FALSE(data < end && !IsControlChar(*data))) {
743 ++data;
744 }
745 if (ARROW_PREDICT_FALSE(data == end)) {
746 return skipped_rows;
747 }
748 c = *data++;
749 } while (c != '\r' && c != '\n');
750 if (c == '\r' && data < end && *data == '\n') {
751 ++data;
752 }
753 *out_data = data;
754 }
755
756 return skipped_rows;
757}
758
759} // namespace csv
760} // namespace arrow

Callers 2

ProcessHeaderMethod · 0.85
CheckSkipRowsFunction · 0.85

Calls 1

IsControlCharFunction · 0.85

Tested by 1

CheckSkipRowsFunction · 0.68