prestodb/presto · error · PrestoException
ACCUMULO_TABLE_EXISTS
ACCUMULO_TABLE_EXISTS
Error message
Accumulo table already exists
What it means
In createAccumuloTable, when Accumulo throws TableExistsException the connector converts it to ACCUMULO_TABLE_EXISTS 'Accumulo table already exists', signaling that the physical Accumulo table of that name is already present and cannot be created again.
Source
Thrown at presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java:90
LOG.warn("NamespaceExistsException suppressed when creating " + schema);
}
}
public boolean exists(String table)
{
return connector.tableOperations().exists(table);
}
public void createAccumuloTable(String table)
{
try {
connector.tableOperations().create(table);
}
catch (AccumuloException | AccumuloSecurityException e) {
throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Failed to create Accumulo table", e);
}
catch (TableExistsException e) {
throw new PrestoException(ACCUMULO_TABLE_EXISTS, "Accumulo table already exists", e);
}
}
public void setLocalityGroups(String tableName, Map<String, Set<Text>> groups)
{
if (groups.isEmpty()) {
return;
}
try {
connector.tableOperations().setLocalityGroups(tableName, groups);
LOG.debug("Set locality groups for %s to %s", tableName, groups);
}
catch (AccumuloException | AccumuloSecurityException e) {
throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Failed to set locality groups", e);
}
catch (TableNotFoundException e) {
throw new PrestoException(ACCUMULO_TABLE_DNE, "Failed to set locality groups, table does not exist", e);View on GitHub (pinned to 55bb57d202)
Solutions
- If the existing Accumulo table is stale/orphaned, delete it in the Accumulo shell ('droptable namespace.table') and retry the Presto CREATE.
- If the table is valid and already in use, skip creation — the data is already there; verify with 'tables list'.
- Use a different table name to avoid the collision.
- Serialize DDL so concurrent sessions don't create the same table simultaneously.
Example fix
// Accumulo shell — remove orphaned physical table left by failed CREATE: droptable myschema.orders // then in Presto: CREATE TABLE myschema.orders (...);
Defensive patterns
Strategy: validation
Validate before calling
// Check for the physical table before creating:
String qualified = schema + "." + table;
if (conn.tableOperations().exists(qualified)) {
// drop if orphaned, or skip creation and proceed
} Try / catch
try {
tableManager.createAccumuloTable(qualified);
} catch (PrestoException e) {
if (e.getErrorCode().getName().equals("ACCUMULO_TABLE_EXISTS")) {
// inspect the existing table: drop if orphaned, otherwise treat creation as done
}
throw e;
} Prevention
- Check tableOperations().exists() before issuing CREATE TABLE.
- Serialize DDL across sessions to avoid duplicate concurrent creations.
- After failed CREATE TABLE runs, clean up orphaned physical Accumulo tables.
- Keep Presto metadata and physical Accumulo tables in sync (drop both sides together).
When it happens
Trigger: Presto CREATE TABLE (or createAccumuloTable called directly) when a table with the same namespace.table name already exists in Accumulo — e.g. a leftover physical table not tracked in the connector metadata, or a duplicate creation racing another session.
Common situations: Previous CREATE TABLE partially failed leaving the Accumulo table but no catalog entry; two concurrent creations of the same table name; repointing Presto at a cluster where the table already exists; case/name collisions.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/8fd0396ac4661bca.
Report an issue: GitHub.