fatemehp commented on code in PR #14545:
URL: https://github.com/apache/arrow/pull/14545#discussion_r1009855139


##########
cpp/src/parquet/column_reader.cc:
##########
@@ -1141,12 +1146,14 @@ int64_t TypedColumnReaderImpl<DType>::ReadBatchSpaced(
 template <typename DType>
 int64_t TypedColumnReaderImpl<DType>::Skip(int64_t num_values_to_skip) {
   int64_t values_to_skip = num_values_to_skip;
-  while (HasNext() && values_to_skip > 0) {
+  // Optimization: Do not call HasNext() when values_to_skip == 0.
+  while (values_to_skip > 0 && HasNext()) {

Review Comment:
   No, this line is the main change. Sorry I should have separated the 
refactoring from this change.
   if (values_to_skip >= available_values) {
   
   Change > to >=



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to