sunchao commented on a change in pull request #33330: URL: https://github.com/apache/spark/pull/33330#discussion_r669324473
########## File path: sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java ########## @@ -255,6 +253,39 @@ private void readBatchInternal( state.advanceOffsetAndRowId(offset, rowId); } + /** + * Skip the next `n` values (either null or non-null) from this definition level reader and + * `valueReader`. + */ + private void skipValues( + int n, + ParquetReadState state, + VectorizedValuesReader valuesReader, + ParquetVectorUpdater updater) { + while (n > 0) { + if (this.currentCount == 0) this.readNextGroup(); + int num = Math.min(n, this.currentCount); + switch (mode) { + case RLE: + // we only need to skip non-null values from `valuesReader` since nulls are represented + // via definition levels which are skipped here via decrementing `currentCount`. + if (currentValue == state.maxDefinitionLevel) { + updater.skipValues(num, valuesReader); + } + break; + case PACKED: + for (int i = 0; i < num; ++i) { + // save as above, only skip non-null values from `valuesReader` Review comment: oops -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org