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

Function SkipRows

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

Source from the content-addressed store, hash-verified

784int64_t BlockParser::first_row_num() const { return impl_->first_row_num(); }
785
786int32_t SkipRows(const uint8_t* data, uint32_t size, int32_t num_rows,
787 const uint8_t** out_data) {
788 const auto end = data + size;
789 int32_t skipped_rows = 0;
790 *out_data = data;
791
792 for (; skipped_rows < num_rows; ++skipped_rows) {
793 uint8_t c;
794 do {
795 while (ARROW_PREDICT_FALSE(data < end && !IsControlChar(*data))) {
796 ++data;
797 }
798 if (ARROW_PREDICT_FALSE(data == end)) {
799 return skipped_rows;
800 }
801 c = *data++;
802 } while (c != '\r' && c != '\n');
803 if (c == '\r' && data < end && *data == '\n') {
804 ++data;
805 }
806 *out_data = data;
807 }
808
809 return skipped_rows;
810}
811
812} // namespace csv
813} // namespace arrow

Callers 2

ProcessHeaderMethod · 0.85
CheckSkipRowsFunction · 0.85

Calls 1

IsControlCharFunction · 0.85

Tested by 1

CheckSkipRowsFunction · 0.68