{"record":{"id":"21201431cc0eacef","repo":"prestodb/presto","slug":"accumulo-table-dne","errorCode":"ACCUMULO_TABLE_DNE","errorMessage":"Table %s does not exist","messagePattern":"Table (.+?) does not exist","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java","lineNumber":489,"sourceCode":"        }\n\n        AccumuloTable oldTable = getTable(oldName);\n        if (oldTable == null) {\n            throw new TableNotFoundException(oldName);\n        }\n\n        AccumuloTable newTable = new AccumuloTable(\n                oldTable.getSchema(),\n                newName.getTableName(),\n                oldTable.getColumns(),\n                oldTable.getRowId(),\n                oldTable.isExternal(),\n                oldTable.getSerializerClassName(),\n                oldTable.getScanAuthorizations());\n\n        // Validate table existence\n        if (!tableManager.exists(oldTable.getFullTableName())) {\n            throw new PrestoException(ACCUMULO_TABLE_DNE, format(\"Table %s does not exist\", oldTable.getFullTableName()));\n        }\n\n        if (tableManager.exists(newTable.getFullTableName())) {\n            throw new PrestoException(ACCUMULO_TABLE_EXISTS, format(\"Table %s already exists\", newTable.getFullTableName()));\n        }\n\n        // Rename index tables (which will also validate table existence)\n        renameIndexTables(oldTable, newTable);\n\n        // Rename the Accumulo table\n        tableManager.renameAccumuloTable(oldTable.getFullTableName(), newTable.getFullTableName());\n\n        // We'll then create the metadata\n        metaManager.deleteTableMetadata(oldTable.getSchemaTableName());\n        metaManager.createTableMetadata(newTable);\n    }\n\n    /**","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java#L471-L507","documentation":"Thrown by AccumuloClient.renameTable when a RENAME TABLE statement targets a source Accumulo table that does not exist in the Accumulo instance. Before performing any rename, the connector validates the old table via tableManager.exists(oldTable.getFullTableName()); if it is absent, the rename is aborted with ACCUMULO_TABLE_DNE. This is a metadata-level check, so the table is missing either because it was never created, was dropped, or the schema/table name was mistyped.","triggerScenarios":"Calling ALTER TABLE old_schema.old_table RENAME TO new_table (via PrestoQueryRunner/StatementClient) when the source table does not exist in Accumulo: table previously dropped out-of-band, table never created but cached in metadata, wrong connector/catalog, or Accumulo namespace mismatch in the fully-qualified table name.","commonSituations":"Developers drop the table directly in the Accumulo shell while Presto metadata still lists it; multi-environment setups where the table exists in a dev Accumulo but not prod; typos in schema or table name; cat/connector misconfiguration pointing at a different Accumulo instance or namespace prefix.","solutions":["Verify the source table exists: run 'SHOW TABLES FROM old_schema' in Presto or 'tables' in the Accumulo shell for the configured namespace.","Recreate the missing table (CREATE TABLE) or restore it before retrying the rename.","Confirm the AccumuloClient configuration (instance, zookeepers, username, namespace) points at the Accumulo instance that actually holds the table.","Check for name typos or case differences in the qualified table name used in the RENAME statement."],"exampleFix":"// before: renaming a table that was dropped out-of-band\nALTER TABLE myschema.events RENAME TO events_old;\n// after: recreate or verify first\nSHOW TABLES FROM myschema; -- confirm 'events' exists\nALTER TABLE myschema.events RENAME TO events_old;","handlingStrategy":"validation","validationCode":"// Presto: confirm the source table exists before renaming\nString sql = \"SELECT table_name FROM information_schema.tables \" +\n             \"WHERE table_schema = 'myschema' AND table_name = 'events'\";\nboolean exists = !new PrestoStatementRunner(connector).queryForRows(sql).isEmpty();\nif (!exists) throw new IllegalStateException(\"Cannot rename: myschema.events does not exist\");","typeGuard":null,"tryCatchPattern":"try {\n    run(\"ALTER TABLE myschema.events RENAME TO events_old\");\n} catch (QueryFailedException e) {\n    if (e.getMessage().contains(\"does not exist\")) {\n        log.warn(\"Source table missing; skipping rename\");\n    } else {\n        throw e;\n    }\n}","preventionTips":["Never drop Accumulo tables directly in the Accumulo shell; use Presto DROP TABLE so connector metadata stays consistent.","Run SHOW TABLES FROM <schema> before scripted renames and fail fast if the source is missing.","Pin each environment's connector config (instance/namespace) so jobs never rename against the wrong Accumulo.","Log and alert on renames of tables absent from the metastore to catch drift early."],"tags":["accumulo","table-not-found","rename","metadata"],"backgroundTag":"table-does-not-exist","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"}