{"record":{"id":"9d2a5a6949d5d471","repo":"prestodb/presto","slug":"iceberg-missing-column-9d2a5a","errorCode":"ICEBERG_MISSING_COLUMN","errorMessage":"Column %s not found in delegate column map","messagePattern":"Column (.+?) not found in delegate column map","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java","lineNumber":205,"sourceCode":"        int lastUpdatedSeqIdx = -1;\n        int rowPosIdx = -1;\n        for (int i = 0; i < outputColumns.size(); i++) {\n            IcebergColumnHandle outputColumn = outputColumns.get(i);\n            if (outputColumn.isUpdateRowIdColumn() || outputColumn.isMergeTargetTableRowIdColumn()) {\n                continue;\n            }\n\n            if (outputColumn.isRowIdColumn()) {\n                // Map to delegate index for reading file values, but also track output index for fallback\n                rowLineageIdx = i;\n            }\n\n            if (outputColumn.isLastUpdatedSequenceNumberColumn()) {\n                lastUpdatedSeqIdx = i;\n            }\n\n            if (!columnToIndex.containsKey(outputColumn.getColumnIdentity())) {\n                throw new PrestoException(ICEBERG_MISSING_COLUMN, format(\"Column %s not found in delegate column map\", outputColumn));\n            }\n            else {\n                outputColumnToDelegateMapping[i] = columnToIndex.get(outputColumn.getColumnIdentity());\n            }\n        }\n        this.rowLineageRowIdOutputIndex = rowLineageIdx;\n        this.lastUpdatedSeqOutputIndex = lastUpdatedSeqIdx;\n\n        // Find the delegate index for ROW_POSITION (needed for _row_id = firstRowId + _pos fallback)\n        if (rowLineageIdx >= 0 && firstRowId >= 0) {\n            for (int i = 0; i < delegateColumns.size(); i++) {\n                if (delegateColumns.get(i).isRowPositionColumn()) {\n                    rowPosIdx = i;\n                    break;\n                }\n            }\n        }\n        this.rowPositionDelegateIndex = rowPosIdx;","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUpdateablePageSource.java#L187-L223","documentation":"IcebergUpdateablePageSource wraps a delegate page source (e.g. for UPDATE with row lineage). During output-column setup, each requested output column must exist in the delegate's columnToIndex map keyed by ColumnIdentity. When an output column is absent from the underlying split's schema, the connector throws ICEBERG_MISSING_COLUMN, indicating the reader cannot supply that column.","triggerScenarios":"Opening an updateable page source where an output column (often the $row_id/last-updated-sequence columns or a normal column) is not present in the delegate's column map — e.g. the table schema changed (column added/renamed) after the query plan was built, or the split metadata is stale.","commonSituations":"Concurrent ALTER TABLE ADD/RENAME COLUMN while an UPDATE runs; cached plans referencing old schema; split/plan produced by a different coordinator version than the worker executing it.","solutions":["Re-run the query so the plan and splits reflect the current table schema.","Check for concurrent ALTER TABLE operations and retry after they complete.","Clear/refresh metadata caches and, if reproducible, verify all nodes run the same Presto version.","Inspect the update assignment and column list to ensure no dropped/renamed column is still referenced."],"exampleFix":"// before (stale plan after RENAME COLUMN col_a -> col_b)\nUPDATE t SET col_a = 'x' WHERE ...\n// after\nUPDATE t SET col_b = 'x' WHERE ... -- re-planned against current schema","handlingStrategy":"try-catch","validationCode":"// before running UPDATE, verify the assignment columns still exist\nfor (String col : updateColumns) {\n    if (!currentTableSchema.getColumnNames().contains(col)) {\n        throw new IllegalStateException(\"Column missing from current schema: \" + col);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    pageSource = createUpdateablePageSource(...);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == ICEBERG_MISSING_COLUMN.toErrorCode()) {\n        // schema changed under us; invalidate plan/split and retry once\n        invalidatePlanCache();\n        pageSource = createUpdateablePageSource(...);\n    } else { throw e; }\n}","preventionTips":["Avoid concurrent ALTER TABLE (add/rename/drop column) while UPDATEs run","Re-plan queries after schema changes instead of reusing cached plans","Keep all Presto nodes on the same version","Verify column names in UPDATE statements against the live schema"],"tags":["iceberg","schema-mismatch","update","missing-column"],"backgroundTag":"schema-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"}