{"record":{"id":"f0f91b918848ed1d","repo":"apache/iceberg","slug":"creating-table-with-computed-columns-is-not-suppor-f0f91b","errorCode":null,"errorMessage":"Creating table with computed columns is not supported yet.","messagePattern":"Creating table with computed columns is not supported yet\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java","lineNumber":633,"sourceCode":"        icebergTable,\n        setLocation,\n        setSnapshotId,\n        cherrypickSnapshotId,\n        schemaChanges,\n        propertyChanges);\n  }\n\n  private static void validateFlinkTable(CatalogBaseTable table) {\n    Preconditions.checkArgument(\n        table instanceof CatalogTable, \"The Table should be a CatalogTable.\");\n\n    org.apache.flink.table.api.Schema schema = table.getUnresolvedSchema();\n    schema\n        .getColumns()\n        .forEach(\n            column -> {\n              if (!FlinkCompatibilityUtil.isPhysicalColumn(column)) {\n                throw new UnsupportedOperationException(\n                    \"Creating table with computed columns is not supported yet.\");\n              }\n            });\n\n    if (!schema.getWatermarkSpecs().isEmpty()) {\n      throw new UnsupportedOperationException(\n          \"Creating table with watermark specs is not supported yet.\");\n    }\n  }\n\n  private static PartitionSpec toPartitionSpec(List<String> partitionKeys, Schema icebergSchema) {\n    PartitionSpec.Builder builder = PartitionSpec.builderFor(icebergSchema);\n    partitionKeys.forEach(builder::identity);\n    return builder.build();\n  }\n\n  private static List<String> toPartitionKeys(PartitionSpec spec, Schema icebergSchema) {\n    ImmutableList.Builder<String> partitionKeysBuilder = ImmutableList.builder();","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java#L615-L651","documentation":"An UnsupportedOperationException from validateFlinkTable rejecting DDL that declares computed (non-physical) columns — e.g. expression/virtual or metadata columns — because Iceberg table creation only supports physical columns.","triggerScenarios":"CREATE TABLE containing a column defined with an expression (computed column, e.g. `ts AS CURRENT_TIMESTAMP` or PROCTIME()) passed through createIcebergTable or alterTable.","commonSituations":"Porting Flink SQL from other connectors (Kafka etc.) where computed columns are common; generating DDL with computed columns for watermarks/time attributes; copying table definitions from a Flink view.","solutions":["Remove the computed column and compute the value at write time in your pipeline.","Store a physical column and populate it via the sink's INSERT statement or a Flink view with the projection.","Define only physical columns in the Iceberg DDL; apply expressions downstream."],"exampleFix":"// before\nCREATE TABLE t (id BIGINT, ts AS CURRENT_TIMESTAMP);\n// after\nCREATE TABLE t (id BIGINT, ts TIMESTAMP(3));","handlingStrategy":"validation","validationCode":"boolean hasComputed = table.getUnresolvedSchema().getColumns().stream()\n    .anyMatch(c -> !FlinkCompatibilityUtil.isPhysicalColumn(c));\nif (hasComputed) { /* remove computed columns before create */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define only physical columns in Iceberg DDL","Compute derived values at write time or in Flink views","Strip computed/metadata columns from generated DDL templates"],"tags":["flink","ddl","computed-columns","unsupported"],"backgroundTag":"operation-not-supported","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}