cloud-fan commented on a change in pull request #33695:
URL: https://github.com/apache/spark/pull/33695#discussion_r745320877



##########
File path: 
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java
##########
@@ -204,26 +225,34 @@ void readBatch(int total, WritableColumnVector column) 
throws IOException {
           boolean isUnsignedInt64 = 
updaterFactory.isUnsignedIntTypeMatched(64);
 
           boolean needTransform = castLongToInt || isUnsignedInt32 || 
isUnsignedInt64;
-          column.setDictionary(new ParquetDictionary(dictionary, 
needTransform));
+          values.setDictionary(new ParquetDictionary(dictionary, 
needTransform));
         } else {
-          updater.decodeDictionaryIds(readState.offset - startOffset, 
startOffset, column,
+          updater.decodeDictionaryIds(readState.valueOffset - startOffset, 
startOffset, values,
             dictionaryIds, dictionary);
         }
       } else {
-        if (column.hasDictionary() && readState.offset != 0) {
+        if (values.hasDictionary() && readState.valueOffset != 0) {
           // This batch already has dictionary encoded values but this new 
page is not. The batch
           // does not support a mix of dictionary and not so we will decode 
the dictionary.
-          updater.decodeDictionaryIds(readState.offset, 0, column, 
dictionaryIds, dictionary);
+          updater.decodeDictionaryIds(readState.valueOffset, 0, values, 
dictionaryIds, dictionary);
         }
-        column.setDictionary(null);
+        values.setDictionary(null);
         VectorizedValuesReader valuesReader = (VectorizedValuesReader) 
dataColumn;
-        defColumn.readBatch(readState, column, valuesReader, updater);
+        if (readState.maxRepetitionLevel == 0) {
+          defColumn.readBatch(readState, values, definitionLevels, 
valuesReader, updater);
+        } else {
+          repColumn.readBatchNested(readState, repetitionLevels, defColumn, 
definitionLevels,
+            values, valuesReader, updater);
+        }
       }
     }
   }
 
   private int readPage() {
     DataPage page = pageReader.readPage();
+    if (page == null) {

Review comment:
       It's always great to put these nice details in code comments, as there 
are so many small tricks people don't know




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to