prestodb/presto · error · UnsupportedOperationException

Unsupported type for 'hour':

Error message

Unsupported type for 'hour': 

What it means

PartitionTransforms.getColumnTransform implements the hour transform only for TIMESTAMP (and microsecond timestamp) types; other types reaching the hour branch raise this NOT_SUPPORTED error, indicating an invalid partition field declaration.

Source

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

                if (type.equals(TIMESTAMP)) {
                    LongUnaryOperator transformHour = value -> epochHour(value);
                    return new ColumnTransform(transform, INTEGER,
                            block -> transformBlock(TIMESTAMP, block, transformHour),
                            ValueTransform.from(TIMESTAMP, transformHour));
                }
                if (type.equals(TIMESTAMP_MICROSECONDS)) {
                    LongUnaryOperator transformHour = value -> epochHour(Math.floorDiv(value, 1000));
                    return new ColumnTransform(transform, INTEGER,
                            block -> transformBlock(TIMESTAMP_MICROSECONDS, block, transformHour),
                            ValueTransform.from(TIMESTAMP_MICROSECONDS, transformHour));
                }
                if (type.equals(TIMESTAMP_WITH_TIME_ZONE)) {
                    LongUnaryOperator transformHour = value -> epochHour(unpackMillisUtc(value));
                    return new ColumnTransform(transform, INTEGER,
                            block -> transformBlock(TIMESTAMP_WITH_TIME_ZONE, block, transformHour),
                            ValueTransform.from(TIMESTAMP_WITH_TIME_ZONE, transformHour));
                }
                throw new UnsupportedOperationException("Unsupported type for 'hour': " + field);
        }

        Matcher matcher = BUCKET_PATTERN.matcher(transform);
        if (matcher.matches()) {
            int count = parseInt(matcher.group(1));
            if (type.equals(INTEGER)) {
                return new ColumnTransform(transform, INTEGER,
                        block -> bucketInteger(block, count),
                        (block, position) -> bucketValueInteger(block, position, count));
            }
            if (type.equals(BIGINT)) {
                return new ColumnTransform(transform, INTEGER,
                        block -> bucketBigint(block, count),
                        (block, position) -> bucketValueBigint(block, position, count));
            }
            if (isShortDecimal(type)) {
                DecimalType decimal = (DecimalType) type;
                return new ColumnTransform(transform, INTEGER,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use hour() only on TIMESTAMP partition columns
  2. Correct the partition spec so the transform matches the column type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java:179 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/96fd9c2a54c7b6d7. Report an issue: GitHub.