prestodb/presto · error
UNEXPECTED_ACCUMULO_ERROR
UNEXPECTED_ACCUMULO_ERROR
Error message
Exception when getting cardinality
What it means
ColumnCardinalityCache.getCardinalities fans out several concurrent range-count tasks against the Accumulo metrics table and joins them via futures; this catch-all wraps any ExecutionException or InterruptedException from that join into UNEXPECTED_ACCUMULO_ERROR. It means an underlying cardinality computation failed for a reason the connector does not classify more precisely.
Source
Thrown at presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/ColumnCardinalityCache.java:168
}
}
// If the smallest cardinality is present and below the threshold, set the earlyReturn flag
Optional<Entry<Long, AccumuloColumnConstraint>> smallestCardinality = cardinalityToConstraints.entries().stream().findFirst();
if (smallestCardinality.isPresent()) {
if (smallestCardinality.get().getKey() <= earlyReturnThreshold) {
LOG.info("Cardinality %s, is below threshold. Returning early while other tasks finish", smallestCardinality);
earlyReturn = true;
}
}
}
while (!earlyReturn && cardinalityToConstraints.entries().size() < numTasks);
}
catch (ExecutionException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Exception when getting cardinality", e);
}
// Create a copy of the cardinalities
return ImmutableMultimap.copyOf(cardinalityToConstraints);
}
/**
* Gets the column cardinality for all of the given range values. May reach out to the
* metrics table in Accumulo to retrieve new cache elements.
*
* @param schema Table schema
* @param table Table name
* @param auths Scan authorizations
* @param family Accumulo column family
* @param qualifier Accumulo column qualifier
* @param colValues All range values to summarize for the cardinality
* @return The cardinality of the column
*/View on GitHub (pinned to 55bb57d202)
Solutions
- Inspect the wrapped cause (the PrestoException carries the original ExecutionException) to find the real Accumulo/network failure and fix that.
- Retry the query - transient tablet-server or scanner failures often resolve on their own.
- Check the Accumulo monitor and logs for errors on the metrics table around the failure time.
- If the cause is InterruptedException, avoid cancelling the query or address coordinator/worker shutdown during scans.
- Increase scanner/timeout settings if scans against the metrics table are timing out.
Defensive patterns
Strategy: retry
Try / catch
try {
multimap = cache.getCardinalities(constraints);
} catch (PrestoException e) {
if (e.getErrorCode().getName().equals("UNEXPECTED_ACCUMULO_ERROR")) {
if (e.getCause() instanceof InterruptedException) {
Thread.currentThread().interrupt(); // honor cancellation
}
// inspect e.getCause() for the real Accumulo failure; retry transient errors
} else {
throw e;
}
} Prevention
- Retry queries that fail with this error once - many causes are transient Accumulo/timeout issues.
- Monitor Accumulo tablet-server health; restarts commonly interrupt cardinality scans.
- Avoid cancelling queries mid-scan; interrupts surface as this error.
- Check the wrapped cause in logs to distinguish timeouts from genuine Accumulo faults.
When it happens
Trigger: One or more concurrent range-scan tasks against the metrics table failed (Accumulo client error, scanner timeout, tablet server loss), or the thread waiting on the futures was interrupted by query cancellation or shutdown.
Common situations: Accumulo tablet server restart or timeout during a query using index cardinalities; scanner timeouts on the metrics table; user cancelling the Presto query mid-scan (interrupt); network instability between Presto workers and Accumulo.
Related errors
- FUNCTION_IMPLEMENTATION_ERROR
- FUNCTION_IMPLEMENTATION_ERROR
- ACCUMULO_TABLE_DNE
- ALREADY_EXISTS
- INVALID_VIEW
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/c6ff72419d64b63b.
Report an issue: GitHub.