{"record":{"id":"96fd9c2a54c7b6d7","repo":"prestodb/presto","slug":"unsupported-type-for-hour","errorCode":null,"errorMessage":"Unsupported type for 'hour': ","messagePattern":"Unsupported type for 'hour': ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java","lineNumber":179,"sourceCode":"                if (type.equals(TIMESTAMP)) {\n                    LongUnaryOperator transformHour = value -> epochHour(value);\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP, block, transformHour),\n                            ValueTransform.from(TIMESTAMP, transformHour));\n                }\n                if (type.equals(TIMESTAMP_MICROSECONDS)) {\n                    LongUnaryOperator transformHour = value -> epochHour(Math.floorDiv(value, 1000));\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP_MICROSECONDS, block, transformHour),\n                            ValueTransform.from(TIMESTAMP_MICROSECONDS, transformHour));\n                }\n                if (type.equals(TIMESTAMP_WITH_TIME_ZONE)) {\n                    LongUnaryOperator transformHour = value -> epochHour(unpackMillisUtc(value));\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP_WITH_TIME_ZONE, block, transformHour),\n                            ValueTransform.from(TIMESTAMP_WITH_TIME_ZONE, transformHour));\n                }\n                throw new UnsupportedOperationException(\"Unsupported type for 'hour': \" + field);\n        }\n\n        Matcher matcher = BUCKET_PATTERN.matcher(transform);\n        if (matcher.matches()) {\n            int count = parseInt(matcher.group(1));\n            if (type.equals(INTEGER)) {\n                return new ColumnTransform(transform, INTEGER,\n                        block -> bucketInteger(block, count),\n                        (block, position) -> bucketValueInteger(block, position, count));\n            }\n            if (type.equals(BIGINT)) {\n                return new ColumnTransform(transform, INTEGER,\n                        block -> bucketBigint(block, count),\n                        (block, position) -> bucketValueBigint(block, position, count));\n            }\n            if (isShortDecimal(type)) {\n                DecimalType decimal = (DecimalType) type;\n                return new ColumnTransform(transform, INTEGER,","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java#L161-L197","documentation":"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.","triggerScenarios":"Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use hour() only on TIMESTAMP partition columns","Correct the partition spec so the transform matches the column type"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}