{"record":{"id":"8e07630dbe7bd77e","repo":"prestodb/presto","slug":"validation-failed","errorCode":null,"errorMessage":"Validation failed","messagePattern":"Validation failed","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcReader.java","lineNumber":518,"sourceCode":"                    false,\n                    dwrfEncryptionProvider,\n                    dwrfKeyProvider,\n                    new RuntimeStats(),\n                    Optional.empty(),\n                    MODIFICATION_TIME_NOT_SET);\n            try (OrcBatchRecordReader orcRecordReader = orcReader.createBatchRecordReader(\n                    readTypes.build(),\n                    OrcPredicate.TRUE,\n                    hiveStorageTimeZone,\n                    NOOP_ORC_AGGREGATED_MEMORY_CONTEXT,\n                    INITIAL_BATCH_SIZE)) {\n                while (orcRecordReader.nextBatch() >= 0) {\n                    // ignored\n                }\n            }\n        }\n        catch (IOException e) {\n            throw new OrcCorruptionException(e, input.getId(), \"Validation failed\");\n        }\n    }\n\n    public static void validateWrite(Optional<OrcWriteValidation> writeValidation, OrcDataSource orcDataSource, Predicate<OrcWriteValidation> test, String messageFormat, Object... args)\n            throws OrcCorruptionException\n    {\n        if (writeValidation.isPresent() && !test.test(writeValidation.get())) {\n            throw new OrcCorruptionException(orcDataSource.getId(), \"Write validation failed: \" + messageFormat, args);\n        }\n    }\n\n    public OrcDataSource getOrcDataSource()\n    {\n        return orcDataSource;\n    }\n\n    public StripeFooter readStripeFooter(StripeInformation stripe)\n            throws IOException","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcReader.java#L500-L536","documentation":"validateFile reads all stripes/batches back to verify a written file against an OrcWriteValidation. Any IOException during that full read means the file could not be read as written, wrapped as OrcCorruptionException(\"Validation failed\").","triggerScenarios":"OrcReader.validateFile invoked after a write with write validation enabled, and orcRecordReader.nextBatch() throws IOException mid-read (truncated data, bad checksum, I/O failure).","commonSituations":"Disk full/IO errors during write leaving a truncated file, storage layer corruption, network filesystem glitches, concurrent modification of the file during validation.","solutions":["Read the chained IOException cause for the underlying I/O problem","Check the storage/disk health and free space","Rewrite the ORC file and re-run validation","Verify file completeness (size/checksum) against the writer's expectations"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-write: ensure sufficient disk space for the target file\nif (fs.getUsed() + estimatedSize > fs.getCapacity() * 0.9) { throw new IOException(\"insufficient space\"); }","typeGuard":null,"tryCatchPattern":"try { OrcReader.validateFile(...); }\ncatch (OrcCorruptionException e) {\n    if (e.getCause() instanceof IOException) { /* retry write once on fresh path, else alert */ }\n}","preventionTips":["Monitor disk space during writes","Write to temp file then atomic-rename","Avoid concurrent access to files under validation"],"tags":["orc","io","validation","corruption"],"backgroundTag":"write-validation-failed","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"}