apache/seatunnel · error · UnsupportedOperationException

Unsupported transform:

Error message

Unsupported transform: 

What it means

SchemaUtils.createPartitionSpec parses a partition transform string (e.g. bucket[16,col], truncate[10,col], year, month, day, hour) from the SeaTunnel catalog partition key specification and maps it to Iceberg PartitionSpec builder calls. If the transform name is not one of the recognized switch cases, it throws UnsupportedOperationException with the raw transform string. The partition key uses an Iceberg transform the connector does not support.

Source

Thrown at seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/utils/SchemaUtils.java:364

                                break;
                            case "hour":
                            case "hours":
                                specBuilder.hour(matcher.group(2));
                                break;
                            case "bucket":
                                {
                                    Pair<String, Integer> args = transformArgPair(matcher.group(2));
                                    specBuilder.bucket(args.first(), args.second());
                                    break;
                                }
                            case "truncate":
                                {
                                    Pair<String, Integer> args = transformArgPair(matcher.group(2));
                                    specBuilder.truncate(args.first(), args.second());
                                    break;
                                }
                            default:
                                throw new UnsupportedOperationException(
                                        "Unsupported transform: " + transform);
                        }
                    } else {
                        specBuilder.identity(partitionField);
                    }
                });
        return specBuilder.build();
    }

    private static Pair<String, Integer> transformArgPair(String argsStr) {
        String[] parts = argsStr.split(",");
        if (parts.length != 2) {
            throw new IllegalArgumentException(
                    "Invalid argument " + argsStr + ", should have 2 parts");
        }
        return Pair.of(parts[0].trim(), Integer.parseInt(parts[1].trim()));
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use a supported transform name exactly: identity, year, month, day, hour, bucket[N], truncate[N]
  2. Fix typos in the partition config (the message echoes the offending transform string)
  3. Map unsupported engine-specific transforms to the nearest Iceberg equivalent (e.g. date_trunc -> month/day/hour)
  4. If a valid Iceberg transform is missing, add a case in createPartitionSpec's switch that calls specBuilder accordingly

Example fix

// before
partition = { key = "ts"; transform = "date_trunc[hour]" }
// after
partition = { key = "ts"; transform = "hour" }
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<String> supported = Set.of("identity","year","month","day","hour","bucket","truncate");
if (!supported.contains(transformName.toLowerCase())) {
    throw new IllegalArgumentException("Unsupported transform: " + transformName);
}

Try / catch

try {
    Table table = catalog.createTable(...);
} catch (UnsupportedOperationException e) {
    log.error("Partition transform rejected: {}", e.getMessage());
    throw e;
}

Prevention

When it happens

Trigger: Configuring an Iceberg sink/catalog table partition property with a transform name outside the supported set (identity, year, month, day, hour, bucket[N], truncate[N]) — e.g. a typo like 'buket[16]', a plural like 'days', or unsupported transforms such as 'void'.

Common situations: Users copy partition syntax from other engines (Hive/Spark date_trunc style) that the connector's switch doesn't accept; typos in HOCON config; transforms valid in raw Iceberg API but missing a case in createPartitionSpec.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/732ff5a8ef0ddd87. Report an issue: GitHub.