{"record":{"id":"354ad5cefe9f30ab","repo":"prestodb/presto","slug":"hudi-cannot-open-split-354ad5","errorCode":"HUDI_CANNOT_OPEN_SPLIT","errorMessage":"Error opening Hive split ${split} using ${inputFormatName}: ${firstNonNull(e.getMessage(), e.getClass().getName())}","messagePattern":"Error opening Hive split (.+?) using (.+?): (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hudi/src/main/java/com/facebook/presto/hudi/HudiRecordCursors.java","lineNumber":133,"sourceCode":"        String inputFormatName = split.getPartition().getStorage().getStorageFormat().getInputFormat();\n        InputFormat<?, ?> inputFormat = createInputFormat(jobConf, inputFormatName);\n\n        // create record reader for split\n        try {\n            HudiFile baseFile = getHudiBaseFile(split);\n            Path path = new Path(baseFile.getPath());\n            FileSplit fileSplit = new FileSplit(path, baseFile.getStart(), baseFile.getLength(), (String[]) null);\n            List<HoodieLogFile> logFiles = split.getLogFiles().stream().map(file -> new HoodieLogFile(file.getPath())).collect(toList());\n            String tablePath = split.getTable().getPath();\n            FileSplit hudiSplit = new HoodieRealtimeFileSplit(fileSplit, tablePath, logFiles, split.getInstantTime(), false, Option.empty());\n            return inputFormat.getRecordReader(hudiSplit, jobConf, Reporter.NULL);\n        }\n        catch (IOException e) {\n            String msg = format(\"Error opening Hive split %s using %s: %s\",\n                    split,\n                    inputFormatName,\n                    firstNonNull(e.getMessage(), e.getClass().getName()));\n            throw new PrestoException(HUDI_CANNOT_OPEN_SPLIT, msg, e);\n        }\n    }\n\n    private static InputFormat<?, ?> createInputFormat(Configuration conf, String inputFormat)\n    {\n        try {\n            Class<?> clazz = conf.getClassByName(inputFormat);\n            @SuppressWarnings(\"unchecked\") Class<? extends InputFormat<?, ?>> cls =\n                    (Class<? extends InputFormat<?, ?>>) clazz.asSubclass(InputFormat.class);\n            return ReflectionUtils.newInstance(cls, conf);\n        }\n        catch (ClassNotFoundException | RuntimeException e) {\n            throw new PrestoException(HUDI_CANNOT_OPEN_SPLIT, \"Unable to create input format \" + inputFormat, e);\n        }\n    }\n\n    private static void refineCompressionCodecs(Configuration conf)\n    {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hudi/src/main/java/com/facebook/presto/hudi/HudiRecordCursors.java#L115-L151","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the chained IOException cause and confirm the file referenced by the split exists and is readable","Repair or exclude the affected file/commit (Hudi rollback/repair), or re-run the query against a fresh snapshot","Fix HDFS permissions for the Presto service user on the table path","Retry after transient HDFS failures; investigate compaction/clean schedules if files keep disappearing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return cursor(split);\n} catch (PrestoException e) {\n    if (isHudiErrorCode(e, \"HUDI_CANNOT_OPEN_SPLIT\")\n            && e.getCause() instanceof IOException\n            && isTransientIo(e.getCause())) {\n        return withRetry(3, backoff(), () -> cursor(split));\n    }\n    throw e; // missing/corrupt files need repair, not retry\n}","preventionTips":["Align compaction/cleaning schedules with query windows so files aren't removed mid-scan","Verify Presto user permissions on all data paths (including log files for MOR tables)","Rewrite or roll back corrupt commits before querying","Keep split metadata fresh; resync after heavy compaction/clustering"],"tags":["presto","hudi","record-reader","split","io"],"backgroundTag":"cannot-open-split","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"}