Skip to content

Commit d18a880

Browse files
viiryaIsaac
andcommitted
Add the page and column once for a missing dictionary, and fix a comment
- Shorten the missing dictionary error in `initDataReader` to "the dictionary was missing for encoding ...", since `readPageV1` and `readPageV2` add the page and column. - Say which exception types `readPageV1` and `readPageV2` add the page and column to. Co-authored-by: Isaac <[email protected]>
1 parent 3398c18 commit d18a880

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ private void initDataReader(
368368
if (dataEncoding.usesDictionary()) {
369369
this.dataColumn = null;
370370
if (dictionary == null) {
371-
throw new IOException(
372-
"could not read page in col " + descriptor +
373-
" as the dictionary was missing for encoding " + dataEncoding);
371+
throw new IOException("the dictionary was missing for encoding " + dataEncoding);
374372
}
375373
@SuppressWarnings("deprecation")
376374
Encoding plainDict = Encoding.PLAIN_DICTIONARY; // var to allow warning suppression
@@ -385,7 +383,8 @@ private void initDataReader(
385383
this.isCurrentPageDictionaryEncoded = false;
386384
}
387385

388-
// readPageV1 and readPageV2 add the page and the column to any error thrown here.
386+
// readPageV1 and readPageV2 add the page and the column to an IOException or a
387+
// ParquetDecodingException thrown here.
389388
dataColumn.initFromPage(pageValueCount, in);
390389
// for PARQUET-246 (See VectorizedDeltaByteArrayReader.setPreviousValues)
391390
if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, dataEncoding) &&

0 commit comments

Comments
 (0)