Skip to content

Commit 50f367f

Browse files
viiryadongjoon-hyun
authored andcommitted
[SPARK-59854][SQL] Report the column in decoding errors of the vectorized Parquet reader
### What changes were proposed in this pull request? This is a follow-up of SPARK-59832 (#59117). That change added the page and the column to errors from initializing a data page in `VectorizedColumnReader`. This PR adds the column to the decoding errors that still do not report it: - **Decoding a batch.** `readBatch` wraps a `ParquetDecodingException` thrown while decoding values or levels in a `ParquetDecodingException` that names the page and the column: `could not decode page <page> in col <column>: <original message>`. This covers the `ParquetDecodingException`s of the RLE, PLAIN, DELTA_BINARY_PACKED, DELTA_LENGTH_BYTE_ARRAY, DELTA_BYTE_ARRAY and BYTE_STREAM_SPLIT readers. Only `ParquetDecodingException` is caught, so other exceptions keep their types: `SchemaColumnConvertNotSupportedException` and `SparkUpgradeException`, which `FileDataSourceV2.attachFilePath` dispatches on, and the `RuntimeException` of a vector that cannot grow, which `ParquetStorageFilter.rethrowIfMustPropagate` dispatches on. The reader keeps only the description of the current page, not the page, because for codecs that decompress lazily the page holds the decompressor stream. - **Reading a data page.** parquet-java decompresses ZSTD pages eagerly, inside `PageReader.readPage()`, which was outside every catch. Its `ParquetDecodingException` (`could not decompress page`) now gets the column. Only `ParquetDecodingException` is caught here, because `readPage()` also decrypts pages, and decryption errors are not decoding errors. - **Reading the dictionary.** `readDictionaryPage()` and `Encoding.initDictionary` now share one `try`, so a dictionary page that cannot be read fails with `could not decode the dictionary for <column>` whether it is decompressed eagerly (ZSTD) or when `initDictionary` reads its bytes (SNAPPY, GZIP). Besides `IOException` and `ParquetDecodingException`, it wraps the three runtime exceptions a corrupted dictionary page or page header causes there: an `IndexOutOfBoundsException` when a BINARY dictionary ends within the length of an entry, a `NegativeArraySizeException` for a negative size, and an `UnsupportedOperationException` for an encoding that has no dictionary. Other runtime exceptions are not wrapped, so a bug in the reader is not reported as a corrupt dictionary. - **DELTA_BINARY_PACKED.** `VectorizedDeltaBinaryPackedReader.initFromPage` checked the page value count and the mini block size with `checkArgument`, which throws an `IllegalArgumentException`. These checks now throw a `ParquetDecodingException`, like the block size checks next to them, and the mini block size is checked with integer arithmetic. A mini block bit width above 64, which failed with an `ArrayIndexOutOfBoundsException`, is now rejected with a `ParquetDecodingException` when the mini block is unpacked. The existing page wrappers and the new batch wrapper then add the page and the column. - **An empty column chunk.** The constructor's `totalValueCount == 0` error, which a corrupt footer can cause, now names the column as well. Each wrapper keeps the original message and adds a single layer to the cause chain. These cases are not covered: - An out-of-range dictionary id fails with an `ArrayIndexOutOfBoundsException` from `Dictionary.decodeTo*`, either in `readBatch` or, with lazy dictionary decoding, after `readBatch` returns. Reporting the column for it needs a check of every id against the dictionary size, so it is left to SPARK-60317. - A dictionary page whose declared size or entry lengths do not fit in the page can end in an `OutOfMemoryError` or, for an uncompressed chunk, return bytes of the next page. That is left to SPARK-60316. - A corrupt LZ4_RAW or LZ4 page fails with a `RuntimeException` of the codec library, aircompressor's `MalformedInputException` or lz4-java's `LZ4Exception`, which parquet-java does not turn into an `IOException`. - A negative uncompressed size in the header of a compressed data page fails with a `NegativeArraySizeException`, in `readPage()` for ZSTD and LZ4_RAW and in `readPageV1` or `readPageV2` for the other codecs. - With a pushed filter, parquet-java's `DictionaryFilter` reads dictionary pages while it filters row groups, before any `VectorizedColumnReader` exists, so a dictionary page that cannot be read there fails without the column. ### Why are the changes needed? Without the column, a decoding error from a corrupted file does not say which column is affected. For example, a truncated RLE run fails with only `Corrupted RLE data: reading past the end of the encoded values`. When `VectorizedColumnReader` reads a SNAPPY or GZIP data page, a decompression error already reports the column, because the page is decompressed lazily inside the existing catch. ZSTD pages did not report it. ### Does this PR introduce _any_ user-facing change? Yes, in error messages only. The decoding errors above now name the column, and the page for errors while decoding a batch. The corrupt dictionaries above now fail with a `ParquetDecodingException` that names the column instead of an `IndexOutOfBoundsException`, `NegativeArraySizeException` or `UnsupportedOperationException`, which is kept as the cause. The DELTA_BINARY_PACKED checks now throw a `ParquetDecodingException` instead of the `IllegalArgumentException` of the value count and mini block size checks, or the `ArrayIndexOutOfBoundsException` of a bit width above 64, and the page and the column are added to it. A ZSTD dictionary page that cannot be decompressed now fails with `could not decode the dictionary for <column>`. Valid files are not affected. ### How was this patch tested? New tests: - `ParquetVectorizedSuite`: - A truncated RLE dictionary id section and truncated PLAIN values report the page and the column, with the original `ParquetDecodingException` as the cause. - A truncated BINARY dictionary, a negative dictionary size and a dictionary page with a non-dictionary encoding report the column. - A mini block bit width of 65 in a DELTA_BINARY_PACKED page reports the page and the column, like the truncated pages above, and an invalid DELTA_BINARY_PACKED header reports the column. - A column chunk without values reports the column. - `ParquetDeltaEncodingSuite`: mini blocks that are not a multiple of 8 values and a page with no values are rejected with a `ParquetDecodingException`. - `ParquetIOSuite`: a ZSTD data page and a ZSTD dictionary page that cannot be decompressed report the column. The test shares a helper with the SPARK-59832 tests, including their timeout. All new tests fail without this change. Existing suites also pass: `VectorizedRleValuesReaderSuite`, `ParquetEncodingSuite`, `ParquetVectorizedSuite`, `ParquetColumnIndexSuite`, `ParquetIOSuite`, `ParquetV1QuerySuite`, `ParquetV2QuerySuite`, `ParquetDeltaEncodingSuite`, `ParquetDeltaByteArrayEncodingSuite`, `ParquetDeltaLengthByteArrayEncodingSuite`, `VectorizedPlainValuesReaderSuite`, `ParquetVectorUpdaterSuite` and `ParquetCompressionCodecPrecedenceSuite`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) This pull request and its description were written by Isaac. Closes #59542 from viirya/SPARK-59854. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 8c9aa48) Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 8fa200a commit 50f367f

6 files changed

Lines changed: 319 additions & 128 deletions

File tree

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

Lines changed: 109 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ public class VectorizedColumnReader {
9797
*/
9898
private long pageFirstRowIndex;
9999

100+
/**
101+
* The data page the values are being decoded from, for error messages. Only its description is
102+
* kept: for codecs that decompress lazily, the page holds the decompressor stream.
103+
*/
104+
private String currentPage;
105+
100106
private final PageReader pageReader;
101107
private final ColumnDescriptor descriptor;
102108
private final LogicalTypeAnnotation logicalTypeAnnotation;
@@ -126,23 +132,33 @@ public VectorizedColumnReader(
126132
int96RebaseMode,
127133
int96RebaseTz);
128134

129-
DictionaryPage dictionaryPage = pageReader.readDictionaryPage();
130-
if (dictionaryPage != null) {
131-
try {
132-
this.dictionary = dictionaryPage.getEncoding().initDictionary(descriptor, dictionaryPage);
133-
this.isCurrentPageDictionaryEncoded = true;
134-
} catch (IOException e) {
135-
throw new IOException("could not decode the dictionary for " + descriptor, e);
136-
} catch (ParquetDecodingException e) {
137-
throw new ParquetDecodingException(
138-
"could not decode the dictionary for " + descriptor + ": " + e.getMessage(), e);
135+
Dictionary dict = null;
136+
try {
137+
// This decompresses the page eagerly for some codecs, e.g. ZSTD.
138+
DictionaryPage dictionaryPage = pageReader.readDictionaryPage();
139+
if (dictionaryPage != null) {
140+
dict = dictionaryPage.getEncoding().initDictionary(descriptor, dictionaryPage);
139141
}
140-
} else {
141-
this.dictionary = null;
142-
this.isCurrentPageDictionaryEncoded = false;
142+
} catch (IOException e) {
143+
throw new IOException("could not decode the dictionary for " + descriptor, e);
144+
} catch (ParquetDecodingException e) {
145+
throw new ParquetDecodingException(
146+
"could not decode the dictionary for " + descriptor + ": " + e.getMessage(), e);
147+
} catch (IndexOutOfBoundsException | NegativeArraySizeException |
148+
UnsupportedOperationException e) {
149+
// Reading the dictionary page decompresses it, for some codecs only when initDictionary
150+
// reads its bytes, and initDictionary parses it. A corrupted page or page header makes
151+
// them throw these: an IndexOutOfBoundsException when a BINARY dictionary ends within the
152+
// length of an entry, a NegativeArraySizeException for a negative size, and an
153+
// UnsupportedOperationException for an encoding that has no dictionary. An entry that
154+
// claims more bytes than the page has is not detected here (SPARK-60316).
155+
throw new ParquetDecodingException(
156+
"could not decode the dictionary for " + descriptor + ": " + e, e);
143157
}
158+
this.dictionary = dict;
159+
this.isCurrentPageDictionaryEncoded = dict != null;
144160
if (pageReader.getTotalValueCount() == 0) {
145-
throw new IOException("totalValueCount == 0");
161+
throw new IOException("totalValueCount == 0 in col " + descriptor);
146162
}
147163
assert "LEGACY".equals(datetimeRebaseMode) || "EXCEPTION".equals(datetimeRebaseMode) ||
148164
"CORRECTED".equals(datetimeRebaseMode);
@@ -252,79 +268,96 @@ void readBatch(
252268
}
253269
readState.resetForNewPage(pageValueCount, pageFirstRowIndex);
254270
}
255-
PrimitiveType.PrimitiveTypeName typeName =
256-
descriptor.getPrimitiveType().getPrimitiveTypeName();
257-
if (isCurrentPageDictionaryEncoded) {
258-
// Save starting offset in case we need to decode dictionary IDs.
259-
int startOffset = readState.valueOffset;
260-
// Save starting row index so we can check if we need to eagerly decode dict ids later
261-
long startRowId = readState.rowId;
262-
263-
// Read and decode dictionary ids.
264-
if (readState.maxRepetitionLevel == 0) {
265-
defColumn.readIntegers(readState, dictionaryIds, column, definitionLevels,
266-
(VectorizedValuesReader) dataColumn);
267-
} else {
268-
repColumn.readIntegersRepeated(readState, repetitionLevels, defColumn, definitionLevels,
269-
dictionaryIds, column, (VectorizedValuesReader) dataColumn);
270-
}
271+
// A corrupted page makes the readers below throw a ParquetDecodingException without the
272+
// column. Only that is wrapped, so that other exceptions, e.g. SparkUpgradeException,
273+
// keep their types.
274+
try {
275+
PrimitiveType.PrimitiveTypeName typeName =
276+
descriptor.getPrimitiveType().getPrimitiveTypeName();
277+
if (isCurrentPageDictionaryEncoded) {
278+
// Save starting offset in case we need to decode dictionary IDs.
279+
int startOffset = readState.valueOffset;
280+
// Save starting row index so we can check if we need to eagerly decode dict ids later
281+
long startRowId = readState.rowId;
282+
283+
// Read and decode dictionary ids.
284+
if (readState.maxRepetitionLevel == 0) {
285+
defColumn.readIntegers(readState, dictionaryIds, column, definitionLevels,
286+
(VectorizedValuesReader) dataColumn);
287+
} else {
288+
repColumn.readIntegersRepeated(readState, repetitionLevels, defColumn, definitionLevels,
289+
dictionaryIds, column, (VectorizedValuesReader) dataColumn);
290+
}
271291

272-
// TIMESTAMP_MILLIS encoded as INT64 can't be lazily decoded as we need to post process
273-
// the values to add microseconds precision.
274-
if (column.hasDictionary() || (startRowId == pageFirstRowIndex &&
275-
isLazyDecodingSupported(typeName, column.dataType()))) {
276-
// Column vector supports lazy decoding of dictionary values so just set the dictionary.
277-
// We can't do this if startRowId is not the first row index in the page AND the column
278-
// doesn't have a dictionary (i.e. some non-dictionary encoded values have already been
279-
// added).
280-
PrimitiveType primitiveType = descriptor.getPrimitiveType();
281-
282-
// We need to make sure that we initialize the right type for the dictionary otherwise
283-
// WritableColumnVector will throw an exception when trying to decode to an Int when the
284-
// dictionary is in fact initialized as Long
285-
LogicalTypeAnnotation typeAnnotation = primitiveType.getLogicalTypeAnnotation();
286-
boolean castLongToInt =
287-
typeAnnotation instanceof DecimalLogicalTypeAnnotation annotation &&
288-
annotation.getPrecision() <= Decimal.MAX_INT_DIGITS() &&
289-
primitiveType.getPrimitiveTypeName() == INT64;
290-
291-
// We require a long value, but we need to use dictionary to decode the original
292-
// signed int first
293-
boolean isUnsignedInt32 = updaterFactory.isUnsignedIntTypeMatched(32);
294-
295-
// We require a decimal value, but we need to use dictionary to decode the original
296-
// signed long first
297-
boolean isUnsignedInt64 = updaterFactory.isUnsignedIntTypeMatched(64);
298-
299-
boolean needTransform = castLongToInt || isUnsignedInt32 || isUnsignedInt64;
300-
column.setDictionary(new ParquetDictionary(dictionary, needTransform));
301-
} else {
302-
updater.decodeDictionaryIds(readState.valueOffset - startOffset, startOffset, column,
303-
dictionaryIds, dictionary);
304-
}
305-
} else {
306-
if (column.hasDictionary() && readState.valueOffset != 0) {
307-
// This batch already has dictionary encoded values but this new page is not. The batch
308-
// does not support a mix of dictionary and not so we will decode the dictionary.
309-
updater.decodeDictionaryIds(readState.valueOffset, 0, column, dictionaryIds, dictionary);
310-
}
311-
column.setDictionary(null);
312-
VectorizedValuesReader valuesReader = (VectorizedValuesReader) dataColumn;
313-
if (readState.maxRepetitionLevel == 0) {
314-
defColumn.readBatch(readState, column, definitionLevels, valuesReader, updater);
292+
// TIMESTAMP_MILLIS encoded as INT64 can't be lazily decoded as we need to post process
293+
// the values to add microseconds precision.
294+
if (column.hasDictionary() || (startRowId == pageFirstRowIndex &&
295+
isLazyDecodingSupported(typeName, column.dataType()))) {
296+
// Column vector supports lazy decoding of dictionary values so just set the dictionary.
297+
// We can't do this if startRowId is not the first row index in the page AND the column
298+
// doesn't have a dictionary (i.e. some non-dictionary encoded values have already been
299+
// added).
300+
PrimitiveType primitiveType = descriptor.getPrimitiveType();
301+
302+
// We need to make sure that we initialize the right type for the dictionary otherwise
303+
// WritableColumnVector will throw an exception when trying to decode to an Int when the
304+
// dictionary is in fact initialized as Long
305+
LogicalTypeAnnotation typeAnnotation = primitiveType.getLogicalTypeAnnotation();
306+
boolean castLongToInt =
307+
typeAnnotation instanceof DecimalLogicalTypeAnnotation annotation &&
308+
annotation.getPrecision() <= Decimal.MAX_INT_DIGITS() &&
309+
primitiveType.getPrimitiveTypeName() == INT64;
310+
311+
// We require a long value, but we need to use dictionary to decode the original
312+
// signed int first
313+
boolean isUnsignedInt32 = updaterFactory.isUnsignedIntTypeMatched(32);
314+
315+
// We require a decimal value, but we need to use dictionary to decode the original
316+
// signed long first
317+
boolean isUnsignedInt64 = updaterFactory.isUnsignedIntTypeMatched(64);
318+
319+
boolean needTransform = castLongToInt || isUnsignedInt32 || isUnsignedInt64;
320+
column.setDictionary(new ParquetDictionary(dictionary, needTransform));
321+
} else {
322+
updater.decodeDictionaryIds(readState.valueOffset - startOffset, startOffset, column,
323+
dictionaryIds, dictionary);
324+
}
315325
} else {
316-
repColumn.readBatchRepeated(readState, repetitionLevels, defColumn, definitionLevels,
317-
column, valuesReader, updater);
326+
if (column.hasDictionary() && readState.valueOffset != 0) {
327+
// This batch already has dictionary encoded values but this new page is not. The batch
328+
// does not support a mix of dictionary and not so we will decode the dictionary.
329+
updater.decodeDictionaryIds(readState.valueOffset, 0, column, dictionaryIds,
330+
dictionary);
331+
}
332+
column.setDictionary(null);
333+
VectorizedValuesReader valuesReader = (VectorizedValuesReader) dataColumn;
334+
if (readState.maxRepetitionLevel == 0) {
335+
defColumn.readBatch(readState, column, definitionLevels, valuesReader, updater);
336+
} else {
337+
repColumn.readBatchRepeated(readState, repetitionLevels, defColumn, definitionLevels,
338+
column, valuesReader, updater);
339+
}
318340
}
341+
} catch (ParquetDecodingException e) {
342+
throw new ParquetDecodingException("could not decode page " + currentPage + " in col " +
343+
descriptor + ": " + e.getMessage(), e);
319344
}
320345
}
321346
}
322347

323348
private int readPage() {
324-
DataPage page = pageReader.readPage();
349+
DataPage page;
350+
try {
351+
// This decompresses the page eagerly for some codecs, e.g. ZSTD.
352+
page = pageReader.readPage();
353+
} catch (ParquetDecodingException e) {
354+
throw new ParquetDecodingException(
355+
"could not read the next page in col " + descriptor + ": " + e.getMessage(), e);
356+
}
325357
if (page == null) {
326358
return -1;
327359
}
360+
this.currentPage = page.toString();
328361
this.pageFirstRowIndex = page.getFirstRowIndex().orElse(0L);
329362

330363
return page.accept(new DataPage.Visitor<Integer>() {

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

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.apache.parquet.column.values.bitpacking.Packer;
2727
import org.apache.parquet.io.ParquetDecodingException;
2828

29-
import org.apache.spark.network.util.JavaUtils;
3029
import org.apache.spark.sql.catalyst.util.RebaseDateTime;
3130
import org.apache.spark.sql.execution.datasources.DataSourceUtils;
3231
import org.apache.spark.sql.execution.vectorized.WritableColumnVector;
@@ -89,8 +88,10 @@ public class VectorizedDeltaBinaryPackedReader extends VectorizedReaderBase {
8988

9089
@Override
9190
public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException {
92-
JavaUtils.checkArgument(valueCount >= 1,
93-
"Page must have at least one value, but it has " + valueCount);
91+
if (valueCount < 1) {
92+
throw new ParquetDecodingException("Invalid DELTA_BINARY_PACKED page: it must have at "
93+
+ "least one value, but it has " + valueCount);
94+
}
9495
this.in = in;
9596
// Read the header
9697
this.blockSizeInValues = BytesUtils.readUnsignedVarInt(in);
@@ -100,14 +101,17 @@ public void initFromPage(int valueCount, ByteBufferInputStream in) throws IOExce
100101
throw new ParquetDecodingException("Invalid DELTA_BINARY_PACKED block size in values: "
101102
+ blockSizeInValues + " (must be in [1, " + MAX_BLOCK_SIZE_IN_VALUES + "])");
102103
}
103-
if (miniBlockNumInABlock <= 0 || miniBlockNumInABlock > blockSizeInValues) {
104+
if (miniBlockNumInABlock <= 0) {
104105
throw new ParquetDecodingException("Invalid DELTA_BINARY_PACKED mini block count: "
105106
+ miniBlockNumInABlock + " (block size in values: " + blockSizeInValues + ")");
106107
}
107-
double miniSize = (double) blockSizeInValues / miniBlockNumInABlock;
108-
JavaUtils.checkArgument(miniSize % 8 == 0,
109-
"miniBlockSize must be multiple of 8, but it's " + miniSize);
110-
this.miniBlockSizeInValues = (int) miniSize;
108+
if (blockSizeInValues % miniBlockNumInABlock != 0 ||
109+
(blockSizeInValues / miniBlockNumInABlock) % 8 != 0) {
110+
throw new ParquetDecodingException("Invalid DELTA_BINARY_PACKED mini block count: "
111+
+ miniBlockNumInABlock + " (block size in values: " + blockSizeInValues
112+
+ ", the mini block size must be a multiple of 8)");
113+
}
114+
this.miniBlockSizeInValues = blockSizeInValues / miniBlockNumInABlock;
111115
// True value count. May be less than valueCount because of nulls
112116
this.totalValueCount = BytesUtils.readUnsignedVarInt(in);
113117
if (totalValueCount < 0) {
@@ -472,9 +476,15 @@ private void readBlockHeader() {
472476
* see org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesReader#unpackMiniBlock
473477
*/
474478
private void unpackMiniBlock() throws IOException {
479+
int bitWidth = bitWidths[currentMiniBlock];
480+
// The bit widths of the unused mini blocks of the last block can be anything, so a width is
481+
// checked only when its mini block is unpacked.
482+
if (bitWidth > 64) {
483+
throw new ParquetDecodingException("Invalid DELTA_BINARY_PACKED mini block bit width: "
484+
+ bitWidth + " (must be at most 64)");
485+
}
475486
Arrays.fill(this.unpackedValuesBuffer, 0);
476-
BytePackerForLong packer = Packer.LITTLE_ENDIAN.newBytePackerForLong(
477-
bitWidths[currentMiniBlock]);
487+
BytePackerForLong packer = Packer.LITTLE_ENDIAN.newBytePackerForLong(bitWidth);
478488
for (int j = 0; j < miniBlockSizeInValues; j += 8) {
479489
ByteBuffer buffer = in.slice(packer.getBitWidth());
480490
if (buffer.hasArray()) {

‎sql/core/src/test/java/test/org/apache/parquet/column/page/TestDataPage.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@ public Optional<Integer> getIndexRowCount() {
4141
public <T> T accept(Visitor<T> visitor) {
4242
return wrapped.accept(visitor);
4343
}
44+
45+
@Override
46+
public String toString() {
47+
return wrapped.toString();
48+
}
4449
}

‎sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetDeltaEncodingSuite.scala‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,25 @@ abstract class ParquetDeltaEncodingSuite[T] extends ParquetCompatibilityTest
204204
reader.initFromPage(100, craftHeader(128, 4, -1))
205205
}
206206
assert(e3.getMessage.contains("total value count"))
207+
208+
// The mini blocks must have a multiple of 8 values: 128 values do not split into 3 mini
209+
// blocks, and split into 32 mini blocks of 4 values.
210+
Seq(3, 32).foreach { miniBlockNum =>
211+
reader = new VectorizedDeltaBinaryPackedReader
212+
val e4 = intercept[ParquetDecodingException] {
213+
reader.initFromPage(100, craftHeader(128, miniBlockNum, 1))
214+
}
215+
assert(e4.getMessage == s"Invalid DELTA_BINARY_PACKED mini block count: $miniBlockNum " +
216+
"(block size in values: 128, the mini block size must be a multiple of 8)")
217+
}
218+
219+
// A page must have at least one value.
220+
reader = new VectorizedDeltaBinaryPackedReader
221+
val e5 = intercept[ParquetDecodingException] {
222+
reader.initFromPage(0, craftHeader(128, 4, 1))
223+
}
224+
assert(e5.getMessage ==
225+
"Invalid DELTA_BINARY_PACKED page: it must have at least one value, but it has 0")
207226
}
208227

209228
test("skip()") {

0 commit comments

Comments
 (0)