{"record":{"id":"fc48f6a0d1cd7757","repo":"prestodb/presto","slug":"hive-cannot-open-split-fc48f6","errorCode":"HIVE_CANNOT_OPEN_SPLIT","errorMessage":"Error opening Hive split %s (offset=%s, length=%s): %s","messagePattern":"Error opening Hive split (.+?) \\(offset=(.+?), length=(.+?)\\): (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/parquet/ParquetPageSourceFactoryUtils.java","lineNumber":61,"sourceCode":"            throw new PrestoException(HIVE_BAD_DATA, e);\n        }\n        if (e instanceof AccessControlException) {\n            throw new PrestoException(PERMISSION_DENIED, e.getMessage(), e);\n        }\n        if (nullToEmpty(e.getMessage()).trim().equals(\"Filesystem closed\") ||\n                e instanceof FileNotFoundException) {\n            throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, e);\n        }\n        String message = format(\"Error opening Hive split %s (offset=%s, length=%s): %s\", path, fileSplit.getStart(), fileSplit.getLength(), e.getMessage());\n        if (e.getClass().getSimpleName().equals(\"BlockMissingException\")) {\n            throw new PrestoException(HIVE_MISSING_DATA, message, e);\n        }\n        if (e instanceof HiddenColumnException) {\n            message = format(\"User does not have access to encryption key for encrypted column = %s. If returning 'null' for encrypted \" +\n                    \"columns is acceptable to your query, please add 'set session hive.read_null_masked_parquet_encrypted_value_enabled=true' before your query\", ((HiddenColumnException) e).getColumn());\n            throw new PrestoException(PERMISSION_DENIED, message, e);\n        }\n        throw new PrestoException(HIVE_CANNOT_OPEN_SPLIT, message, e);\n    }\n}\n","sourceCodeStart":43,"sourceCodeEnd":64,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/parquet/ParquetPageSourceFactoryUtils.java#L43-L64","documentation":"This is the fallback branch of mapToPrestoException: any exception opening a Hive Parquet split that is not 'Filesystem closed', FileNotFoundException, BlockMissingException, or HiddenColumnException is wrapped as HIVE_CANNOT_OPEN_SPLIT with a message containing the split path, offset and length. It is a generic wrapper for all other split-open failures.","triggerScenarios":"hdfs open of the split throws any other IOException/RuntimeException — e.g. connectivity failures to the NameNode, InvalidInputException (path is a directory/not a file), checksum errors, auth/token expiry (not classified as FileNotFoundException), S3/ABFS client errors when the table is not actually on HDFS.","commonSituations":"NameNode unreachable or in safemode; Kerberos/DelegationToken expired mid-query; file removed while query was planning (but path pattern still resolves oddly); reading HDFS-backed tables from a cluster whose core-site/HA config is wrong; cloud-storage (S3) misconfiguration surfaced as a generic IOException.","solutions":["Read the wrapped cause ('Caused by') in the message to identify the real underlying failure","Verify the file exists and is a regular file at the split path, and that the NameNode/storage endpoint is reachable from the worker","Check authentication: re-authenticate (kinit) or refresh delegation tokens/Hive metastore credentials","For cloud storage, verify connector properties (endpoint, credentials, region) and retry after fixing configuration"],"exampleFix":"// before: split path points at a directory after a misconfigured partition location\nALTER TABLE t SET LOCATION 'hdfs:///data/t/'; -- files in nested dirs not matching pattern\n// after\nALTER TABLE t SET LOCATION 'hdfs:///data/t/ds=2026-01-01'; -- point to the actual parquet files' parent","handlingStrategy":"try-catch","validationCode":"// Pre-flight: the split path must exist, be a regular file, and be readable\nFileSystem fs = path.getFileSystem(conf);\nif (!fs.exists(path)) throw new IllegalStateException(\"Split path missing: \" + path);\nif (!fs.getFileStatus(path).isFile()) throw new IllegalStateException(\"Not a file: \" + path);\nFSDataInputStream in = fs.open(path); in.close(); // auth/connectivity probe","typeGuard":null,"tryCatchPattern":"try {\n    readSplit(split);\n} catch (PrestoException e) {\n    if (HIVE_CANNOT_OPEN_SPLIT.equals(e.getErrorCode())) {\n        Throwable cause = e.getCause();\n        LOG.warn(\"Cannot open split %s, cause=%s\", split.getPath(), cause);\n        retryWithBackoffOrRequeue(split, cause); // auth refresh / endpoint re-check / retry\n    } else { throw e; }\n}","preventionTips":["Always inspect the 'Caused by' chain — this error is only a generic wrapper","Keep Kerberos tickets/delegation tokens refreshed for long-running queries","Verify NameNode HA and core-site configs on all worker nodes","Test filesystem connectivity (hdfs dfs -cat) from worker hosts before launching queries"],"tags":["hive","hdfs","io","split-open"],"backgroundTag":"cannot-open-file-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"}