prestodb/presto · error · PrestoException

HUDI_CURSOR_ERROR

HUDI_CURSOR_ERROR

Error message

HUDI_CURSOR_ERROR

What it means

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.

Source

Thrown at presto-hudi/src/main/java/com/facebook/presto/hudi/HudiPageSource.java:155

            if (!hasPrefilledBlocks) {
                return dataPage;
            }
            int batchSize = dataPage.getPositionCount();
            Block[] blocks = new Block[prefilledBlocks.length];
            for (int i = 0; i < prefilledBlocks.length; i++) {
                if (prefilledBlocks[i] != null) {
                    blocks[i] = new RunLengthEncodedBlock(prefilledBlocks[i], batchSize);
                }
                else {
                    blocks[i] = dataPage.getBlock(delegateIndexes[i]);
                }
            }
            return new Page(batchSize, blocks);
        }
        catch (RuntimeException e) {
            closeWithSuppression(e);
            throwIfInstanceOf(e, PrestoException.class);
            throw new PrestoException(HUDI_CURSOR_ERROR, e);
        }
    }

    @Override
    public void close()
    {
        try {
            delegate.close();
        }
        catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }

    @Override
    public String toString()
    {
        return delegate.toString();

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Inspect the wrapped cause (the exception chained to HUDI_CURSOR_ERROR) to find the real failure
  2. Validate that the queried table's schema matches the on-disk files (run filesystem consistency checks / rewind bad commits)
  3. Identify and repair or exclude the specific corrupted file/commit via Hudi's rollback/clean tooling
  4. Upgrade the Presto/Hudi connector version if the cause points to a known conversion bug
Defensive patterns

Strategy: try-catch

Try / catch

try {
    return pageSource.getNextPage();
} catch (PrestoException e) {
    if (HUDI_CURSOR_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode()) {
        Throwable root = e.getCause();
        log.error("Hudi cursor failed; root cause", root);
        // decide: retry on transient IO, fail on schema/corruption
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/3b8892ebb2f6ad67. Report an issue: GitHub.