{"record":{"id":"4811d7e39c4b7756","repo":"prestodb/presto","slug":"unexpected-column-in-row-group-s-in-stripe-at-off","errorCode":null,"errorMessage":"Unexpected column in row group %s in stripe at offset %s","messagePattern":"Unexpected column in row group (.+?) in stripe at offset (.+?)","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java","lineNumber":303,"sourceCode":"                throw new OrcCorruptionException(orcDataSourceId, \"Unexpected row group count stripe in at offset %s\", stripeOffset);\n            }\n        }\n\n        for (int rowGroupIndex = 0; rowGroupIndex < expectedRowGroupStatistics.size(); rowGroupIndex++) {\n            RowGroupStatistics expectedRowGroup = expectedRowGroupStatistics.get(rowGroupIndex);\n            if (expectedRowGroup.getValidationMode() != HASHED) {\n                Map<Integer, ColumnStatistics> expectedStatistics = expectedRowGroup.getColumnStatistics();\n                Map<Integer, ColumnStatistics> actualStatistics = aggregateRowGroupStatisticsFromRowIndex(orcDataSourceId, actualRowGroupStatistics, stripeOffset, rowGroupIndex);\n\n                // remove empty row group stats for empty flat maps\n                expectedStatistics = adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, expectedStatistics);\n                actualStatistics = adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, actualStatistics);\n\n                Set<Integer> actualColumns = actualStatistics.keySet();\n                Set<Integer> expectedColumns = expectedStatistics.keySet();\n\n                if (!expectedColumns.equals(actualColumns)) {\n                    throw new OrcCorruptionException(orcDataSourceId, \"Unexpected column in row group %s in stripe at offset %s\", rowGroupIndex, stripeOffset);\n                }\n\n                for (Entry<StreamId, List<RowGroupIndex>> entry : actualRowGroupStatistics.entrySet()) {\n                    int column = entry.getKey().getColumn();\n                    ColumnStatistics actual = actualStatistics.get(column);\n                    ColumnStatistics expected = expectedStatistics.get(column);\n                    validateColumnStatisticsEquivalent(orcDataSourceId, \"Row group \" + rowGroupIndex + \" in stripe at offset \" + stripeOffset, actual, expected);\n                }\n            }\n\n            if (expectedRowGroup.getValidationMode() != DETAILED) {\n                Map<Integer, ColumnStatistics> actualStatistics = aggregateRowGroupStatisticsFromRowIndex(orcDataSourceId, actualRowGroupStatistics, stripeOffset, rowGroupIndex);\n                actualStatistics = adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, actualStatistics);\n                RowGroupStatistics actualRowGroup = new RowGroupStatistics(BOTH, actualStatistics);\n                RowGroupStatistics adjustedExpectedRowGroup = new RowGroupStatistics(BOTH, adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, expectedRowGroup.getColumnStatistics()));\n                if (adjustedExpectedRowGroup.getHash() != actualRowGroup.getHash()) {\n                    throw new OrcCorruptionException(orcDataSourceId, \"Checksum mismatch for row group %s in stripe at offset %s\", rowGroupIndex, stripeOffset);\n                }","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java#L285-L321","documentation":"Write-validation error: the set of columns present in a row group's statistics differs from the expected set (a column appears in the file that the writer did not record, or vice versa). Fires per row group while validating non-hashed stats; indicates stats/column divergence between writer record and file content.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:303 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report as an ORC writer bug with validation logs","Rewrite the dataset and re-run validation","Check for schema evolution applied inconsistently during the write"],"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"}