{"record":{"id":"44bf7fb0680f7041","repo":"prestodb/presto","slug":"not-found","errorCode":"NOT_FOUND","errorMessage":"Failed to find source column %s to rename to %s","messagePattern":"Failed to find source column (.+?) to rename to (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java","lineNumber":571,"sourceCode":"\n    public void createOrReplaceView(SchemaTableName viewName, String viewData)\n    {\n        if (getView(viewName) != null) {\n            metaManager.deleteViewMetadata(viewName);\n        }\n\n        metaManager.createViewMetadata(new AccumuloView(viewName.getSchemaName(), viewName.getTableName(), viewData));\n    }\n\n    public void dropView(SchemaTableName viewName)\n    {\n        metaManager.deleteViewMetadata(viewName);\n    }\n\n    public void renameColumn(AccumuloTable table, String source, String target)\n    {\n        if (!table.getColumns().stream().anyMatch(columnHandle -> columnHandle.getName().equalsIgnoreCase(source))) {\n            throw new PrestoException(NOT_FOUND, format(\"Failed to find source column %s to rename to %s\", source, target));\n        }\n\n        // Copy existing column list, replacing the old column name with the new\n        ImmutableList.Builder<AccumuloColumnHandle> newColumnList = ImmutableList.builder();\n        for (AccumuloColumnHandle columnHandle : table.getColumns()) {\n            if (columnHandle.getName().equalsIgnoreCase(source)) {\n                newColumnList.add(new AccumuloColumnHandle(\n                        target,\n                        columnHandle.getFamily(),\n                        columnHandle.getQualifier(),\n                        columnHandle.getType(),\n                        columnHandle.getOrdinal(),\n                        columnHandle.getComment(),\n                        columnHandle.isIndexed()));\n            }\n            else {\n                newColumnList.add(columnHandle);\n            }","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java#L553-L589","documentation":"Thrown by renameColumn when no existing column on the Accumulo table matches the source column name (case-insensitively). The rename is a metadata-only operation, and it cannot proceed if the source column is absent from the table's column list. This typically means the column name was mistyped or the table metadata is out of sync.","triggerScenarios":"Calling renameColumn(table, source, target) where table.getColumns() has no columnHandle whose getName() equalsIgnoreCase(source).","commonSituations":"Typo in the source column name; renaming a column that was already renamed; column exists in the underlying data but not in the connector's table metadata (stale metadata after external changes); case/format mismatch for indexed column families/qualifiers.","solutions":["Verify the exact column name with DESCRIBE <table> or SHOW COLUMNS FROM <table> and retry","Confirm the table metadata in the connector matches the actual Accumulo table (column families/qualifiers)","Check whether the column was already renamed and use the current name","Recreate the table metadata if it is stale or out of sync with Accumulo"],"exampleFix":"// before\nALTER TABLE my_schema.events RENAME COLUMN usr_id TO user_id; -- source column usr_id not found\n// after\n-- DESCRIBE my_schema.events shows the column is named user_id already, or:\nALTER TABLE my_schema.events RENAME COLUMN userid TO user_id; -- exact existing name","handlingStrategy":"validation","validationCode":"// Java: verify the source column exists before renaming\nboolean sourceExists = table.getColumns().stream()\n    .anyMatch(c -> c.getName().equalsIgnoreCase(sourceColumn));\nif (!sourceExists) {\n    throw new IllegalArgumentException(\"Column \" + sourceColumn + \" does not exist on \" + table.getName());\n}","typeGuard":"boolean hasColumn(AccumuloTable table, String name) {\n    return table.getColumns().stream()\n        .anyMatch(c -> c.getName().equalsIgnoreCase(name));\n}","tryCatchPattern":"try {\n    client.renameColumn(table, source, target);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NOT_FOUND\")) {\n        // refresh table metadata / verify column name via DESCRIBE, then retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always DESCRIBE the table and copy the exact column name before renaming","Check whether the column was already renamed (idempotency guard in scripts)","Refresh/rebuild table metadata if it may be stale relative to Accumulo","Remember matching is case-insensitive but the name must otherwise match exactly"],"tags":["accumulo","column-not-found","rename","metadata"],"backgroundTag":"column-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"}