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

Method SkipRows

cpp/src/parquet/stream_reader.cc:438–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438int64_t StreamReader::SkipRows(int64_t num_rows_to_skip) {
439 if (0 != column_index_) {
440 throw ParquetException("Must finish reading current row before skipping rows.");
441 }
442 int64_t num_rows_remaining_to_skip = num_rows_to_skip;
443
444 while (!eof_ && (num_rows_remaining_to_skip > 0)) {
445 int64_t num_rows_in_row_group = row_group_reader_->metadata()->num_rows();
446 int64_t num_rows_remaining_in_row_group =
447 num_rows_in_row_group - (current_row_ - row_group_row_offset_);
448
449 if (num_rows_remaining_in_row_group > num_rows_remaining_to_skip) {
450 for (auto reader : column_readers_) {
451 SkipRowsInColumn(reader.get(), num_rows_remaining_to_skip);
452 }
453 current_row_ += num_rows_remaining_to_skip;
454 num_rows_remaining_to_skip = 0;
455 } else {
456 num_rows_remaining_to_skip -= num_rows_remaining_in_row_group;
457 current_row_ += num_rows_remaining_in_row_group;
458 NextRowGroup();
459 }
460 }
461 return num_rows_to_skip - num_rows_remaining_to_skip;
462}
463
464int64_t StreamReader::SkipColumns(int64_t num_columns_to_skip) {
465 int64_t num_columns_skipped = 0;

Callers 1

TEST_FFunction · 0.80

Calls 4

ParquetExceptionFunction · 0.85
num_rowsMethod · 0.45
metadataMethod · 0.45
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.64