{"record":{"id":"3b8892ebb2f6ad67","repo":"prestodb/presto","slug":"hudi-cursor-error","errorCode":"HUDI_CURSOR_ERROR","errorMessage":"HUDI_CURSOR_ERROR","messagePattern":"HUDI_CURSOR_ERROR","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hudi/src/main/java/com/facebook/presto/hudi/HudiPageSource.java","lineNumber":155,"sourceCode":"            if (!hasPrefilledBlocks) {\n                return dataPage;\n            }\n            int batchSize = dataPage.getPositionCount();\n            Block[] blocks = new Block[prefilledBlocks.length];\n            for (int i = 0; i < prefilledBlocks.length; i++) {\n                if (prefilledBlocks[i] != null) {\n                    blocks[i] = new RunLengthEncodedBlock(prefilledBlocks[i], batchSize);\n                }\n                else {\n                    blocks[i] = dataPage.getBlock(delegateIndexes[i]);\n                }\n            }\n            return new Page(batchSize, blocks);\n        }\n        catch (RuntimeException e) {\n            closeWithSuppression(e);\n            throwIfInstanceOf(e, PrestoException.class);\n            throw new PrestoException(HUDI_CURSOR_ERROR, e);\n        }\n    }\n\n    @Override\n    public void close()\n    {\n        try {\n            delegate.close();\n        }\n        catch (IOException e) {\n            throw new UncheckedIOException(e);\n        }\n    }\n\n    @Override\n    public String toString()\n    {\n        return delegate.toString();","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hudi/src/main/java/com/facebook/presto/hudi/HudiPageSource.java#L137-L173","documentation":"Generic wrapper error for any unexpected RuntimeException thrown while producing a page from the Hudi data source. getNextPage catches all RuntimeExceptions, closes the source with suppression, rethrows PrestoExceptions as-is, and otherwise wraps the cause in HUDI_CURSOR_ERROR so every cursor failure surfaces as a PrestoException.","triggerScenarios":"Any RuntimeException during HudiPageSource.getNextPage() while reading rows: decoder/converter failures, underlying record cursor errors, type coercion errors, or IO problems surfaced as non-Presto runtime exceptions.","commonSituations":"Corrupt Hudi base/log files, schema drift between the table and files, timezone or decimal conversion errors during value decoding, or bugs in the underlying reader.","solutions":["Inspect the wrapped cause (the exception chained to HUDI_CURSOR_ERROR) to find the real failure","Validate that the queried table's schema matches the on-disk files (run filesystem consistency checks / rewind bad commits)","Identify and repair or exclude the specific corrupted file/commit via Hudi's rollback/clean tooling","Upgrade the Presto/Hudi connector version if the cause points to a known conversion bug"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return pageSource.getNextPage();\n} catch (PrestoException e) {\n    if (HUDI_CURSOR_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode()) {\n        Throwable root = e.getCause();\n        log.error(\"Hudi cursor failed; root cause\", root);\n        // decide: retry on transient IO, fail on schema/corruption\n    }\n    throw e;\n}","preventionTips":["Always inspect the cause chain of HUDI_CURSOR_ERROR for the real error","Keep Hudi clean/compaction retention longer than longest query duration","Run periodic table integrity checks (hudi validate/repair tools)","Pin compatible Presto-Hudi connector and table writer versions"],"tags":["presto","hudi","cursor","page-source","wrapped-exception"],"backgroundTag":"record-cursor-runtime-failure","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"}