prestodb/presto · error · PrestoException

HUDI_CANNOT_OPEN_SPLIT

HUDI_CANNOT_OPEN_SPLIT

Error message

Error opening Hive split ${split} using ${inputFormatName}: ${firstNonNull(e.getMessage(), e.getClass().getName())}

What it means

The record reader for a Hive-style split (used by the Hudi record cursor path) failed to open with an IOException; the connector wraps it in HUDI_CANNOT_OPEN_SPLIT with the split and the configured input format class name.

Source

Thrown at presto-hudi/src/main/java/com/facebook/presto/hudi/HudiRecordCursors.java:133

        String inputFormatName = split.getPartition().getStorage().getStorageFormat().getInputFormat();
        InputFormat<?, ?> inputFormat = createInputFormat(jobConf, inputFormatName);

        // create record reader for split
        try {
            HudiFile baseFile = getHudiBaseFile(split);
            Path path = new Path(baseFile.getPath());
            FileSplit fileSplit = new FileSplit(path, baseFile.getStart(), baseFile.getLength(), (String[]) null);
            List<HoodieLogFile> logFiles = split.getLogFiles().stream().map(file -> new HoodieLogFile(file.getPath())).collect(toList());
            String tablePath = split.getTable().getPath();
            FileSplit hudiSplit = new HoodieRealtimeFileSplit(fileSplit, tablePath, logFiles, split.getInstantTime(), false, Option.empty());
            return inputFormat.getRecordReader(hudiSplit, jobConf, Reporter.NULL);
        }
        catch (IOException e) {
            String msg = format("Error opening Hive split %s using %s: %s",
                    split,
                    inputFormatName,
                    firstNonNull(e.getMessage(), e.getClass().getName()));
            throw new PrestoException(HUDI_CANNOT_OPEN_SPLIT, msg, e);
        }
    }

    private static InputFormat<?, ?> createInputFormat(Configuration conf, String inputFormat)
    {
        try {
            Class<?> clazz = conf.getClassByName(inputFormat);
            @SuppressWarnings("unchecked") Class<? extends InputFormat<?, ?>> cls =
                    (Class<? extends InputFormat<?, ?>>) clazz.asSubclass(InputFormat.class);
            return ReflectionUtils.newInstance(cls, conf);
        }
        catch (ClassNotFoundException | RuntimeException e) {
            throw new PrestoException(HUDI_CANNOT_OPEN_SPLIT, "Unable to create input format " + inputFormat, e);
        }
    }

    private static void refineCompressionCodecs(Configuration conf)
    {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the chained IOException cause and confirm the file referenced by the split exists and is readable
  2. Repair or exclude the affected file/commit (Hudi rollback/repair), or re-run the query against a fresh snapshot
  3. Fix HDFS permissions for the Presto service user on the table path
  4. Retry after transient HDFS failures; investigate compaction/clean schedules if files keep disappearing
Defensive patterns

Strategy: retry

Try / catch

try {
    return cursor(split);
} catch (PrestoException e) {
    if (isHudiErrorCode(e, "HUDI_CANNOT_OPEN_SPLIT")
            && e.getCause() instanceof IOException
            && isTransientIo(e.getCause())) {
        return withRetry(3, backoff(), () -> cursor(split));
    }
    throw e; // missing/corrupt files need repair, not retry
}

Prevention

When it happens

Trigger: inputFormat.getRecordReader(...) throws IOException for the given split — missing data file, HDFS read error, split ValidationSequence/permission failure, or the input format rejecting the file.

Common situations: Log/base files removed by Hudi cleaning mid-query, HDFS permissions on data files, corrupt or empty files, split metadata stale after compaction moved files.

Related errors


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