prestodb/presto · error · UnsupportedOperationException

Unsupported partition transform:

Error message

Unsupported partition transform: 

What it means

PartitionTransforms.getColumnTransform maps an Iceberg partition field's transform (identity, year, month, day, hour, bucket, truncate) plus source type to an application function. When the transform name or the transform/type combination is not one of the supported cases, it throws UnsupportedOperationException. This is a code-level guard against partition specs the connector cannot evaluate.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java:300

                                return null;
                            }
                            return truncateVarchar(VARCHAR.getSlice(block, position), width);
                        });
            }
            if (type.equals(VARBINARY)) {
                return new ColumnTransform(transform, VARBINARY,
                        block -> truncateVarbinary(block, width),
                        (block, position) -> {
                            if (block.isNull(position)) {
                                return null;
                            }
                            return truncateVarbinary(VARBINARY.getSlice(block, position), width);
                        });
            }
            throw new UnsupportedOperationException("Unsupported type for 'truncate': " + field);
        }

        throw new UnsupportedOperationException("Unsupported partition transform: " + field);
    }

    private static Block bucketInteger(Block block, int count)
    {
        return bucketBlock(block, count, position -> bucketHash(INTEGER.getLong(block, position)));
    }

    private static int bucketValueInteger(Block block, int position, int count)
    {
        return bucketValue(block, position, count, pos -> bucketHash(INTEGER.getLong(block, pos)));
    }

    private static Block bucketBigint(Block block, int count)
    {
        return bucketBlock(block, count, position -> bucketHash(BIGINT.getLong(block, position)));
    }

    private static int bucketValueBigint(Block block, int position, int count)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Identify the unsupported transform with: SELECT * FROM "table$partitions" or inspect the table's partition spec metadata and note the transform
  2. Recreate or rewrite the table's partition spec using supported transforms: identity, year, month, day, hour, bucket[N], truncate[W] on supported types
  3. If the transform is unsupported but the query doesn't need it, filter/partition pruning may still work — check whether the failing path is partition-pruning only and avoid features that evaluate the transform
  4. Upgrade the Presto Iceberg connector version, as transform support grows over time

Example fix

// before (table created with unsupported transform)
CREATE TABLE t (d DATE, v VARCHAR) WITH (partitioning = ARRAY['void(d)'])
// after
CREATE TABLE t (d DATE, v VARCHAR) WITH (partitioning = ARRAY['day(d)'])
Defensive patterns

Strategy: validation

Validate before calling

Set<String> supported = Set.of("identity","year","month","day","hour","void");
// for each partition field, check transform name and source type compatibility before querying
if (!supported.contains(transformName) && !(transformName.startsWith("bucket") || transformName.startsWith("truncate"))) {
    throw new IllegalStateException("Unsupported partition transform: " + transformName);
}

Type guard

boolean isSupportedTransform(String transform) {
    return transform != null && (Set.of("identity","year","month","day","hour","void").contains(transform)
        || transform.matches("bucket\\(\\d+\\)") || transform.matches("truncate\\[\\d+\\]"));
}

Try / catch

try { /* query table */ } catch (PrestoException e) {
    if ("Unsupported partition transform".equals(e.getMessage())) { /* handle unsupported spec */ }
    throw e;
}

Prevention

When it happens

Trigger: Querying or writing to an Iceberg table whose partition spec contains a transform the connector does not implement (e.g. void transform, bucket on a non-integer/long type, truncate on an unsupported type, or unknown transform strings from tables written by other engines/newer Iceberg versions).

Common situations: Tables created by Spark/Flink with exotic partition transforms being queried via Presto; partition evolution adding unsupported fields; truncate applied to types outside integer/long/string/varbinary.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/e2a59e216d4483f2. Report an issue: GitHub.