prestodb/presto · error · PrestoException

PARQUET_INCORRECT_DECODING

PARQUET_INCORRECT_DECODING

Error message

Wrong count: ex=%d, act=%d, col=%s, file=%s

What it means

Test/verification utility assertion in verifyColumnChunks: the row counts derived from expected vs actual readers of the same column chunk disagree. Used by the Parquet result verifier to compare the production reader against a reference reader; a mismatch signals a decoding bug or corrupt data.

Source

Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetResultVerifierUtils.java:39

import static com.facebook.presto.common.type.TimestampType.TIMESTAMP;
import static java.lang.String.format;

public class ParquetResultVerifierUtils
{
    private ParquetResultVerifierUtils()
    {
    }

    public static void verifyColumnChunks(ColumnChunk actual, ColumnChunk expected, boolean isNestedColumn, PrimitiveField field, ParquetDataSourceId sourceId)
    {
        Block actualBlock = actual.getBlock();
        Block expectedBlock = expected.getBlock();
        Type type = field.getType();
        String column = Joiner.on(".").join(field.getDescriptor().getPath());

        if (actualBlock.getPositionCount() != expectedBlock.getPositionCount()) {
            throw new PrestoException(ParquetErrorCode.PARQUET_INCORRECT_DECODING,
                    format("Wrong count: ex=%d, act=%d, col=%s, file=%s", expectedBlock.getPositionCount(), actualBlock.getPositionCount(), column, sourceId));
        }
        for (int position = 0; position < actualBlock.getPositionCount(); position++) {
            Object actualValue;
            Object expectedValue;
            if (type.equals(TIMESTAMP)) {
                actualValue = actualBlock.isNull(position) ? null : type.getLong(actualBlock, position);
                expectedValue = expectedBlock.isNull(position) ? null : type.getLong(expectedBlock, position);
            }
            else {
                actualValue = type.getObjectValue(null, actualBlock, position);
                expectedValue = type.getObjectValue(null, expectedBlock, position);
            }

            if (actualValue == null || expectedValue == null) {
                if (actualValue != expectedValue) {
                    throw new PrestoException(ParquetErrorCode.PARQUET_INCORRECT_DECODING,
                            format("Wrong value: pos=%d, ex=%s, act=%s, col=%s-%s, file=%s", position, expectedValue, actualValue, column, type, sourceId));

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Report a Presto bug with the file and verifier output if counts differ on valid data
  2. Verify file integrity independently
  3. Isolate the reader path (batch vs selective) that disagrees and disable it pending a fix
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetResultVerifierUtils.java:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/8f0eba6cf0df52dc. Report an issue: GitHub.