{"record":{"id":"d6d7c51f251a471c","repo":"prestodb/presto","slug":"unexpected-metadata","errorCode":null,"errorMessage":"Unexpected metadata","messagePattern":"Unexpected metadata","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java","lineNumber":202,"sourceCode":"    }\n\n    public Map<String, Slice> getMetadata()\n    {\n        return metadata;\n    }\n\n    public void validateMetadata(OrcDataSourceId orcDataSourceId, Map<String, Slice> actualMetadata)\n            throws OrcCorruptionException\n    {\n        if (isDwrf()) {\n            // Filter out metadata value statically added by the DWRF writer\n            actualMetadata = actualMetadata.entrySet().stream()\n                    .filter(entry -> !STATIC_METADATA.containsKey(entry.getKey()))\n                    .collect(toImmutableMap(Entry::getKey, Entry::getValue));\n        }\n\n        if (!metadata.equals(actualMetadata)) {\n            throw new OrcCorruptionException(orcDataSourceId, \"Unexpected metadata\");\n        }\n    }\n\n    public OrcEncoding getOrcEncoding()\n    {\n        return orcEncoding;\n    }\n\n    public boolean isDwrf()\n    {\n        return orcEncoding == DWRF;\n    }\n\n    public ZoneId getTimezone()\n    {\n        return timezone;\n    }\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java#L184-L220","documentation":"Write-validation error in OrcWriteValidation.validateMetadata: when re-reading a file written under validation, the user metadata stored in the file differs from what the writer recorded. This is a corruption/bug detector — the file on disk does not match what the writer produced.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the write job with a fresh output file","Report as a Presto ORC writer bug if reproducible with validation enabled","Disable write validation only as a diagnostic, not 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"}