prestodb/presto · error · PrestoException
HIVE_UNKNOWN_ERROR
HIVE_UNKNOWN_ERROR
Error message
Error reading from %s at position %s.
What it means
The final catch-all in HdfsOrcDataSource.readInternal: any exception that is neither BlockMissingException nor an IOException becomes PrestoException(HIVE_UNKNOWN_ERROR) prefixed with 'Error reading from %s at position %s. '. This preserves the original exception as the cause for later diagnosis.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/orc/HdfsOrcDataSource.java:79
{
try {
long readStart = System.nanoTime();
inputStream.readFully(position, buffer, bufferOffset, bufferLength);
stats.readDataBytesPerSecond(bufferLength, System.nanoTime() - readStart);
}
catch (PrestoException e) {
// just in case there is a Presto wrapper or hook
throw e;
}
catch (Exception e) {
String message = format("Error reading from %s at position %s. ", this, position);
if (e.getClass().getSimpleName().equals("BlockMissingException")) {
throw new PrestoException(HIVE_MISSING_DATA, message, e);
}
if (e instanceof IOException) {
throw new PrestoException(HIVE_FILESYSTEM_ERROR, message + e.getMessage(), e);
}
throw new PrestoException(HIVE_UNKNOWN_ERROR, message, e);
}
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Examine the full stack trace (cause) in the query failure to find the true root exception
- Check worker logs and memory pressure; retry on a healthy cluster if transient
- Verify HDFS delegation tokens / Kerberos credentials are valid for long-running queries
- If reproducible, report with the cause stack trace to the Presto/Hive connector maintainers
Example fix
// before SELECT * FROM t; -- HIVE_UNKNOWN_ERROR: Error reading from ... at position ... // after (diagnose) -- inspect cause stack trace in worker log; renew tokens / increase heap as indicated SELECT * FROM t;
Defensive patterns
Strategy: try-catch
Validate before calling
// precheck cluster health and worker memory before heavy scans -- check HDFS delegation token validity for long queries (hdfs gettoken / job conf)
Try / catch
try {
return query(sql);
} catch (PrestoException e) {
if (e.getErrorCode().getName().equals("HIVE_UNKNOWN_ERROR")) {
logRootCause(e.getCause()); // the original non-IO exception carries the diagnosis
throw new RuntimeException("ORC read failed; see cause", e.getCause());
}
throw e;
} Prevention
- Size worker heaps for the widest ORC columns you scan to avoid OOM during reads
- Keep Kerberos/HDFS delegation tokens valid for the query duration (hive.max-delegation-token-requests, token renewal)
- Treat the wrapped cause as the real bug and report it with full stack traces
- Keep Presto and HDFS client versions aligned/compatible
When it happens
Trigger: A non-IOException (e.g., RuntimeException, OOM from a huge read buffer, UncheckedIOException variant, security exception) escapes the HDFS read call at the requested position.
Common situations: Presto/HDFS client bugs, out-of-memory on workers reading very large columns, Kerberos/token expiry surfacing as unchecked exceptions, misconfigured HDFS settings causing runtime failures.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/6b5674f4af30d807.
Report an issue: GitHub.