prestodb/presto · error · UnsupportedOperationException

Unsupported type for 'truncate':

Error message

Unsupported type for 'truncate': 

What it means

PartitionTransforms.getColumnTransform implements the truncate transform for VARCHAR and VARBINARY (and numeric types elsewhere); a type not supported by truncate reaching this branch raises this NOT_SUPPORTED error, meaning the partition spec truncates an incompatible column.

Source

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

                        block -> truncateVarchar(block, width),
                        (block, position) -> {
                            if (block.isNull(position)) {
                                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)));

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use truncate(w) only on supported types (strings, binaries, integrals)
  2. Choose an appropriate transform for the column type or change the column type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java:297 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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