{"record":{"id":"8f0eba6cf0df52dc","repo":"prestodb/presto","slug":"parquet-incorrect-decoding","errorCode":"PARQUET_INCORRECT_DECODING","errorMessage":"Wrong count: ex=%d, act=%d, col=%s, file=%s","messagePattern":"Wrong count: ex=(.+?), act=(.+?), col=(.+?), file=(.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetResultVerifierUtils.java","lineNumber":39,"sourceCode":"\nimport static com.facebook.presto.common.type.TimestampType.TIMESTAMP;\nimport static java.lang.String.format;\n\npublic class ParquetResultVerifierUtils\n{\n    private ParquetResultVerifierUtils()\n    {\n    }\n\n    public static void verifyColumnChunks(ColumnChunk actual, ColumnChunk expected, boolean isNestedColumn, PrimitiveField field, ParquetDataSourceId sourceId)\n    {\n        Block actualBlock = actual.getBlock();\n        Block expectedBlock = expected.getBlock();\n        Type type = field.getType();\n        String column = Joiner.on(\".\").join(field.getDescriptor().getPath());\n\n        if (actualBlock.getPositionCount() != expectedBlock.getPositionCount()) {\n            throw new PrestoException(ParquetErrorCode.PARQUET_INCORRECT_DECODING,\n                    format(\"Wrong count: ex=%d, act=%d, col=%s, file=%s\", expectedBlock.getPositionCount(), actualBlock.getPositionCount(), column, sourceId));\n        }\n        for (int position = 0; position < actualBlock.getPositionCount(); position++) {\n            Object actualValue;\n            Object expectedValue;\n            if (type.equals(TIMESTAMP)) {\n                actualValue = actualBlock.isNull(position) ? null : type.getLong(actualBlock, position);\n                expectedValue = expectedBlock.isNull(position) ? null : type.getLong(expectedBlock, position);\n            }\n            else {\n                actualValue = type.getObjectValue(null, actualBlock, position);\n                expectedValue = type.getObjectValue(null, expectedBlock, position);\n            }\n\n            if (actualValue == null || expectedValue == null) {\n                if (actualValue != expectedValue) {\n                    throw new PrestoException(ParquetErrorCode.PARQUET_INCORRECT_DECODING,\n                            format(\"Wrong value: pos=%d, ex=%s, act=%s, col=%s-%s, file=%s\", position, expectedValue, actualValue, column, type, sourceId));","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetResultVerifierUtils.java#L21-L57","documentation":"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.","triggerScenarios":"Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/ParquetResultVerifierUtils.java:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report a Presto bug with the file and verifier output if counts differ on valid data","Verify file integrity independently","Isolate the reader path (batch vs selective) that disagrees and disable it pending a fix"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}