{"record":{"id":"b3c853167f1f1773","repo":"prestodb/presto","slug":"unsupported-type-for-month","errorCode":null,"errorMessage":"Unsupported type for 'month': ","messagePattern":"Unsupported type for 'month': ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java","lineNumber":133,"sourceCode":"                if (type.equals(TIMESTAMP)) {\n                    LongUnaryOperator transformMonth = value -> epochMonth(value);\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP, block, transformMonth),\n                            ValueTransform.from(TIMESTAMP, transformMonth));\n                }\n                if (type.equals(TIMESTAMP_MICROSECONDS)) {\n                    LongUnaryOperator transformMonth = value -> epochMonth(Math.floorDiv(value, 1000));\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP_MICROSECONDS, block, transformMonth),\n                            ValueTransform.from(TIMESTAMP_MICROSECONDS, transformMonth));\n                }\n                if (type.equals(TIMESTAMP_WITH_TIME_ZONE)) {\n                    LongUnaryOperator transformMonth = value -> epochMonth(unpackMillisUtc(value));\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP_WITH_TIME_ZONE, block, transformMonth),\n                            ValueTransform.from(TIMESTAMP_WITH_TIME_ZONE, transformMonth));\n                }\n                throw new UnsupportedOperationException(\"Unsupported type for 'month': \" + field);\n            case \"day\":\n                if (type.equals(DATE)) {\n                    LongUnaryOperator transformDay = value -> epochDay(DAYS.toMillis(value));\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(DATE, block, transformDay),\n                            ValueTransform.from(DATE, transformDay));\n                }\n                if (type.equals(TIMESTAMP)) {\n                    LongUnaryOperator transformDay = value -> epochDay(value);\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP, block, transformDay),\n                            ValueTransform.from(TIMESTAMP, transformDay));\n                }\n                if (type.equals(TIMESTAMP_MICROSECONDS)) {\n                    LongUnaryOperator transformDay = value -> epochDay(Math.floorDiv(value, 1000));\n                    return new ColumnTransform(transform, INTEGER,\n                            block -> transformBlock(TIMESTAMP_MICROSECONDS, block, transformDay),\n                            ValueTransform.from(TIMESTAMP_MICROSECONDS, transformDay));","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java#L115-L151","documentation":"PartitionTransforms.getColumnTransform implements the month transform only for date/timestamp types; other column types reaching the month branch trigger this NOT_SUPPORTED error, indicating an invalid transform-to-type pairing in the partition spec.","triggerScenarios":"Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Apply month() only to DATE/TIMESTAMP partition columns","Adjust the partition spec to use a transform valid for the column's type (e.g. truncate or bucket for strings)"],"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"}