{"record":{"id":"e41ebe10ceaca2c9","repo":"prestodb/presto","slug":"hive-unknown-error-e41ebe","errorCode":"HIVE_UNKNOWN_ERROR","errorMessage":"HIVE_UNKNOWN_ERROR (message from cause throwable)","messagePattern":"HIVE_UNKNOWN_ERROR \\(message from cause throwable\\)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveSplitSource.java","lineNumber":833,"sourceCode":"            T current = atomicReference.get();\n            if (!predicate.test(current)) {\n                return false;\n            }\n            if (atomicReference.compareAndSet(current, newValue)) {\n                return true;\n            }\n        }\n    }\n\n    private static RuntimeException propagatePrestoException(Throwable throwable)\n    {\n        if (throwable instanceof PrestoException) {\n            throw (PrestoException) throwable;\n        }\n        if (throwable instanceof FileNotFoundException) {\n            throw new PrestoException(HIVE_FILE_NOT_FOUND, throwable);\n        }\n        throw new PrestoException(HIVE_UNKNOWN_ERROR, throwable);\n    }\n\n    interface PerBucket\n    {\n        ListenableFuture<?> offer(OptionalInt bucketNumber, InternalHiveSplit split);\n\n        ListenableFuture<List<ConnectorSplit>> borrowBatchAsync(OptionalInt bucketNumber, int maxSize, Function<List<InternalHiveSplit>, BorrowResult<InternalHiveSplit, List<ConnectorSplit>>> function);\n\n        default ListenableFuture<List<ConnectorSplit>> borrowBatchAsync(OptionalInt bucketNumber, Map<String, String> partitionValues, int maxSize, Function<List<InternalHiveSplit>, BorrowResult<InternalHiveSplit, List<ConnectorSplit>>> function)\n        {\n            throw new UnsupportedOperationException(\"partition-aware borrowBatchAsync requires a PerBucket implementation that supports partition values\");\n        }\n\n        void noMoreSplits();\n\n        boolean isFinished(OptionalInt bucketNumber);\n\n        default boolean isFinished(OptionalInt bucketNumber, Map<String, String> partitionValues)","sourceCodeStart":815,"sourceCodeEnd":851,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveSplitSource.java#L815-L851","documentation":"The catch-all branch of propagatePrestoException: any throwable from background split loading that is neither a PrestoException nor a FileNotFoundException is wrapped in HIVE_UNKNOWN_ERROR with the cause as the message source. It indicates an unexpected failure during split production for which no specific error code applies.","triggerScenarios":"Async split enumeration tasks fail with arbitrary exceptions (IOException on the metastore/HDFS client, deserialization errors, network resets, NPEs inside the split source) which are rethrown through propagatePrestoException.","commonSituations":"Metastore connectivity drops mid-query; HDFS/S3 client timeouts; corrupt file metadata; bugs in storage handler code paths; cluster authentication token expiry.","solutions":["Inspect the underlying cause (getCause()) in coordinator logs to find the real failure.","Fix the root cause: metastore connectivity, credentials/tokens, storage timeouts, or network issues.","Retry the query if the failure was transient (network blip).","If reproducible, capture the cause stack trace and report as a bug with the full exception chain."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"boolean isUnknownHiveError(PrestoException e) {\n    return HIVE_UNKNOWN_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode();\n}","tryCatchPattern":"try { runQuery(sql); } catch (PrestoException e) {\n    if (isUnknownHiveError(e)) {\n        logRootCause(e.getCause());\n        if (isTransient(e.getCause())) retryWithBackoff(sql); else throw e;\n    } else { throw e; }\n}","preventionTips":["Check coordinator logs for the wrapped cause — HIVE_UNKNOWN_ERROR is only a wrapper","Keep metastore and storage clients healthy (connection pools, token refresh)","Retry only transient causes (timeouts, connection resets), fail fast on logic errors","Report reproducible non-transient failures with the full cause chain"],"tags":["unknown-error","split-source","async"],"backgroundTag":"unknown-storage-error","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"}