prestodb/presto · error · PrestoException

NOT_FOUND

NOT_FOUND

Error message

Failed to find source column %s to rename to %s

What it means

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.

Source

Thrown at presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java:571

    public void createOrReplaceView(SchemaTableName viewName, String viewData)
    {
        if (getView(viewName) != null) {
            metaManager.deleteViewMetadata(viewName);
        }

        metaManager.createViewMetadata(new AccumuloView(viewName.getSchemaName(), viewName.getTableName(), viewData));
    }

    public void dropView(SchemaTableName viewName)
    {
        metaManager.deleteViewMetadata(viewName);
    }

    public void renameColumn(AccumuloTable table, String source, String target)
    {
        if (!table.getColumns().stream().anyMatch(columnHandle -> columnHandle.getName().equalsIgnoreCase(source))) {
            throw new PrestoException(NOT_FOUND, format("Failed to find source column %s to rename to %s", source, target));
        }

        // Copy existing column list, replacing the old column name with the new
        ImmutableList.Builder<AccumuloColumnHandle> newColumnList = ImmutableList.builder();
        for (AccumuloColumnHandle columnHandle : table.getColumns()) {
            if (columnHandle.getName().equalsIgnoreCase(source)) {
                newColumnList.add(new AccumuloColumnHandle(
                        target,
                        columnHandle.getFamily(),
                        columnHandle.getQualifier(),
                        columnHandle.getType(),
                        columnHandle.getOrdinal(),
                        columnHandle.getComment(),
                        columnHandle.isIndexed()));
            }
            else {
                newColumnList.add(columnHandle);
            }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the exact column name with DESCRIBE <table> or SHOW COLUMNS FROM <table> and retry
  2. Confirm the table metadata in the connector matches the actual Accumulo table (column families/qualifiers)
  3. Check whether the column was already renamed and use the current name
  4. Recreate the table metadata if it is stale or out of sync with Accumulo

Example fix

// before
ALTER TABLE my_schema.events RENAME COLUMN usr_id TO user_id; -- source column usr_id not found
// after
-- DESCRIBE my_schema.events shows the column is named user_id already, or:
ALTER TABLE my_schema.events RENAME COLUMN userid TO user_id; -- exact existing name
Defensive patterns

Strategy: validation

Validate before calling

// Java: verify the source column exists before renaming
boolean sourceExists = table.getColumns().stream()
    .anyMatch(c -> c.getName().equalsIgnoreCase(sourceColumn));
if (!sourceExists) {
    throw new IllegalArgumentException("Column " + sourceColumn + " does not exist on " + table.getName());
}

Type guard

boolean hasColumn(AccumuloTable table, String name) {
    return table.getColumns().stream()
        .anyMatch(c -> c.getName().equalsIgnoreCase(name));
}

Try / catch

try {
    client.renameColumn(table, source, target);
} catch (PrestoException e) {
    if (e.getErrorCode().getName().equals("NOT_FOUND")) {
        // refresh table metadata / verify column name via DESCRIBE, then retry
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling renameColumn(table, source, target) where table.getColumns() has no columnHandle whose getName() equalsIgnoreCase(source).

Common situations: 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.

Understand the failure class

Background: NOT_FOUND error code: why tRPC, Harbor, Nacos and other libraries return 404 "not found" errors for resources that may still exist — this error's family across 11 libraries.

Related errors


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