apache/iceberg · error · UnsupportedOperationException

Creating table with computed columns is not supported yet.

Error message

Creating table with computed columns is not supported yet.

What it means

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.

Source

Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:633

        icebergTable,
        setLocation,
        setSnapshotId,
        cherrypickSnapshotId,
        schemaChanges,
        propertyChanges);
  }

  private static void validateFlinkTable(CatalogBaseTable table) {
    Preconditions.checkArgument(
        table instanceof CatalogTable, "The Table should be a CatalogTable.");

    org.apache.flink.table.api.Schema schema = table.getUnresolvedSchema();
    schema
        .getColumns()
        .forEach(
            column -> {
              if (!FlinkCompatibilityUtil.isPhysicalColumn(column)) {
                throw new UnsupportedOperationException(
                    "Creating table with computed columns is not supported yet.");
              }
            });

    if (!schema.getWatermarkSpecs().isEmpty()) {
      throw new UnsupportedOperationException(
          "Creating table with watermark specs is not supported yet.");
    }
  }

  private static PartitionSpec toPartitionSpec(List<String> partitionKeys, Schema icebergSchema) {
    PartitionSpec.Builder builder = PartitionSpec.builderFor(icebergSchema);
    partitionKeys.forEach(builder::identity);
    return builder.build();
  }

  private static List<String> toPartitionKeys(PartitionSpec spec, Schema icebergSchema) {
    ImmutableList.Builder<String> partitionKeysBuilder = ImmutableList.builder();

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Remove the computed column and compute the value at write time in your pipeline.
  2. Store a physical column and populate it via the sink's INSERT statement or a Flink view with the projection.
  3. Define only physical columns in the Iceberg DDL; apply expressions downstream.

Example fix

// before
CREATE TABLE t (id BIGINT, ts AS CURRENT_TIMESTAMP);
// after
CREATE TABLE t (id BIGINT, ts TIMESTAMP(3));
Defensive patterns

Strategy: validation

Validate before calling

boolean hasComputed = table.getUnresolvedSchema().getColumns().stream()
    .anyMatch(c -> !FlinkCompatibilityUtil.isPhysicalColumn(c));
if (hasComputed) { /* remove computed columns before create */ }

Prevention

When it happens

Trigger: CREATE TABLE containing a column defined with an expression (computed column, e.g. `ts AS CURRENT_TIMESTAMP` or PROCTIME()) passed through createIcebergTable or alterTable.

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

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/f0f91b918848ed1d. Report an issue: GitHub.