prestodb/presto · error

UNEXPECTED_ACCUMULO_ERROR

UNEXPECTED_ACCUMULO_ERROR

Error message

Failed to create batch scanner for table %s

What it means

AccumuloRecordSet creates a BatchScanner with 10 query threads against the split's table using the configured scan authorizations. If Accumulo's Connector.createBatchScanner throws (TableNotFoundException, AccumuloSecurityException, AccumuloException), it is wrapped as UNEXPECTED_ACCUMULO_ERROR. The table could not be scanned at all.

Source

Thrown at presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java:99

        catch (Exception e) {
            throw new PrestoException(NOT_FOUND, "Failed to factory serializer class.  Is it on the classpath?", e);
        }

        // Save off the column handles and create a list of the Accumulo types
        this.columnHandles = requireNonNull(columnHandles, "column handles is null");
        ImmutableList.Builder<Type> types = ImmutableList.builder();
        for (AccumuloColumnHandle column : columnHandles) {
            types.add(column.getType());
        }
        this.columnTypes = types.build();

        try {
            // Create the BatchScanner and set the ranges from the split
            scanner = connector.createBatchScanner(split.getFullTableName(), getScanAuthorizations(session, split, connector, username), 10);
            scanner.setRanges(split.getRanges());
        }
        catch (Exception e) {
            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, format("Failed to create batch scanner for table %s", split.getFullTableName()), e);
        }
    }

    /**
     * Gets the scanner authorizations to use for scanning tables.
     * <p>
     * In order of priority: session username authorizations, then table property, then the default connector auths.
     *
     * @param session Current session
     * @param split Accumulo split
     * @param connector Accumulo connector
     * @param username Accumulo username
     * @return Scan authorizations
     * @throws AccumuloException If a generic Accumulo error occurs
     * @throws AccumuloSecurityException If a security exception occurs
     */
    private static Authorizations getScanAuthorizations(ConnectorSession session, AccumuloSplit split, Connector connector, String username)
            throws AccumuloException, AccumuloSecurityException

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the full table name exists in Accumulo (Accumulo shell: tables list) and the split is not stale
  2. Check the Accumulo user has READ permission on the table and that the configured authorizations are a subset of the user's authorizations
  3. Confirm Accumulo connection settings (zookeepers, instance name, credentials) in the catalog properties are correct
  4. Check Accumulo master/tablet server health and network reachability to zookeepers and tserver ports
Defensive patterns

Strategy: retry

Validate before calling

// before querying, confirm table exists and user can scan
Connector conn = ...;
if (!conn.tableOperations().exists(fullTableName)) {
    throw new IllegalStateException("Accumulo table missing: " + fullTableName);
}
conn.securityOperations().hasTablePermission(user, fullTableName, TablePermission.READ);

Try / catch

try {
    // run query against accumulo connector
} catch (PrestoException e) {
    if (e.getErrorCode().getName().equals("UNEXPECTED_ACCUMULO_ERROR") && e.getMessage().contains("batch scanner")) {
        // check table existence / auths, then retry with backoff
    }
    throw e;
}

Prevention

When it happens

Trigger: connector.createBatchScanner(split.getFullTableName(), ...) throwing because the table does not exist, the user lacks scan permissions, or the Accumulo connection/instance is unreachable; also scanner.setRanges failing.

Common situations: Table dropped concurrently while a query was running; scan authorizations configured in the session do not match the user's Accumulo authorizations; Accumulo instance name or zookeepers misconfigured; user credentials lack the Table.READ permission.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/00e1975cbef95b87. Report an issue: GitHub.