viirya commented on a change in pull request #33330: URL: https://github.com/apache/spark/pull/33330#discussion_r669308507
########## File path: sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java ########## @@ -255,6 +253,36 @@ 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: + if (currentValue == state.maxDefinitionLevel) { + updater.skipValues(num, valuesReader); + } + break; + case PACKED: + for (int i = 0; i < num; ++i) { + if (currentBuffer[currentBufferIdx++] == state.maxDefinitionLevel) { + updater.skipValues(1, valuesReader); + } Review comment: ditto. If so, maybe it is good to add a comment. -- 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