{"record":{"id":"2e1271df4cb11232","repo":"prestodb/presto","slug":"accumulo-table-dne-2e1271","errorCode":"ACCUMULO_TABLE_DNE","errorMessage":"Failed to set locality groups, table does not exist","messagePattern":"Failed to set locality groups, table does not exist","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java","lineNumber":108,"sourceCode":"            throw new PrestoException(ACCUMULO_TABLE_EXISTS, \"Accumulo table already exists\", e);\n        }\n    }\n\n    public void setLocalityGroups(String tableName, Map<String, Set<Text>> groups)\n    {\n        if (groups.isEmpty()) {\n            return;\n        }\n\n        try {\n            connector.tableOperations().setLocalityGroups(tableName, groups);\n            LOG.debug(\"Set locality groups for %s to %s\", tableName, groups);\n        }\n        catch (AccumuloException | AccumuloSecurityException e) {\n            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, \"Failed to set locality groups\", e);\n        }\n        catch (TableNotFoundException e) {\n            throw new PrestoException(ACCUMULO_TABLE_DNE, \"Failed to set locality groups, table does not exist\", e);\n        }\n    }\n\n    public void setIterator(String table, IteratorSetting setting)\n    {\n        try {\n            // Remove any existing iterator settings of the same name, if applicable\n            Map<String, EnumSet<IteratorScope>> iterators = connector.tableOperations().listIterators(table);\n            if (iterators.containsKey(setting.getName())) {\n                connector.tableOperations().removeIterator(table, setting.getName(), iterators.get(setting.getName()));\n            }\n\n            connector.tableOperations().attachIterator(table, setting);\n        }\n        catch (AccumuloSecurityException | AccumuloException e) {\n            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, \"Failed to set iterator on table \" + table, e);\n        }\n        catch (TableNotFoundException e) {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java#L90-L126","documentation":"In setLocalityGroups, when Accumulo throws TableNotFoundException the connector throws ACCUMULO_TABLE_DNE 'Failed to set locality groups, table does not exist', meaning the qualified table name passed to Accumulo does not correspond to any existing physical table.","triggerScenarios":"Calling setLocalityGroups for a table that was dropped, was never created, or whose namespace-qualified name doesn't match the physical Accumulo table (e.g. wrong namespace prefix or case).","commonSituations":"CREATE TABLE failed partway so locality groups run before the table exists; table dropped by another process between creation and configuration; namespace mismatch after renaming schemas; typo in the table name.","solutions":["Verify the table exists in Accumulo shell ('tables list | grep <table>') and create it first if missing.","Check the fully qualified table name (namespace.table) matches exactly, including namespace.","Ensure table creation completed successfully before configuring locality groups (order of operations in setup).","Recreate the table if it was dropped unintentionally, then reapply locality groups."],"exampleFix":"// Accumulo shell:\n// before: table never created, setLocalityGroups fails\ncreatetable myschema.orders\n// then re-run the Presto CREATE TABLE / table setup so groups apply","handlingStrategy":"validation","validationCode":"// Confirm the physical table exists before configuring it:\nString qualified = schema + \".\" + table;\nif (!conn.tableOperations().exists(qualified)) {\n  conn.tableOperations().create(qualified); // or abort setup — never configure a missing table\n}","typeGuard":null,"tryCatchPattern":"try {\n  tableManager.setLocalityGroups(tableName, groups);\n} catch (PrestoException e) {\n  if (e.getErrorCode().getName().equals(\"ACCUMULO_TABLE_DNE\")) {\n    // create the table first (or fix the qualified name), then retry\n  }\n  throw e;\n}","preventionTips":["Always call tableOperations().exists() before configuring a table.","Run table setup steps strictly in order: create table, then set locality groups/iterators.","Use exact namespace-qualified names everywhere; avoid ad-hoc name construction.","Alert on table drops so downstream configuration steps don't target missing tables."],"tags":["accumulo","table-not-found","locality-groups","ddl-ordering"],"backgroundTag":"table-not-found","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"}