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

FlinkCatalog.validateFlinkTable rejects any Flink table schema containing non-physical columns, such as computed (metadata/virtual/generated) columns, because Iceberg tables cannot represent them yet. It iterates schema.getColumns() and throws UnsupportedOperationException when FlinkCompatibilityUtil.isPhysicalColumn(column) is false.

Source

Thrown at flink/v2.2/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 computed columns from the DDL and compute them in the query (e.g. with a projection: `SELECT ..., PROCTIME() AS proc FROM iceberg_table`).
  2. Define the computed column in a Flink VIEW on top of the Iceberg table instead of in the table schema.
  3. Only declare physical columns in the Iceberg CREATE TABLE statement.

Example fix

// before
CREATE TABLE t (id BIGINT, proc AS PROCTIME()) WITH ('connector'='iceberg');

// after
CREATE TABLE t (id BIGINT) WITH ('connector'='iceberg');
CREATE VIEW v AS SELECT id, PROCTIME() AS proc FROM t;
Defensive patterns

Strategy: validation

Validate before calling

// reject computed columns before CREATE TABLE
boolean hasComputed = ddlSchema.getColumns().stream()
    .anyMatch(c -> c.getKind() != ColumnKind.PHYSICAL);
if (hasComputed) {
  // move computed columns into a view or the query
}

Try / catch

try {
  catalog.createTable(tablePath, table, false);
} catch (UnsupportedOperationException e) {
  // strip non-physical columns and retry, or create a view
}

Prevention

When it happens

Trigger: CREATE TABLE with a computed column (e.g. `proc AS PROCTIME()` or `ts AS ... GENERATED ALWAYS AS`), or CREATE TABLE LIKE / CTAS that inherits one, routed through createIcebergTable or alterTable in FlinkCatalog.

Common situations: Defining a proctime attribute column in a Flink SQL DDL for an Iceberg sink; porting Hive/Kafka DDL with computed columns to Iceberg.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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