{"record":{"id":"3e09b186454c829b","repo":"prestodb/presto","slug":"unsupported-type-for-truncate","errorCode":null,"errorMessage":"Unsupported type for 'truncate': ","messagePattern":"Unsupported type for 'truncate': ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java","lineNumber":297,"sourceCode":"                        block -> truncateVarchar(block, width),\n                        (block, position) -> {\n                            if (block.isNull(position)) {\n                                return null;\n                            }\n                            return truncateVarchar(VARCHAR.getSlice(block, position), width);\n                        });\n            }\n            if (type.equals(VARBINARY)) {\n                return new ColumnTransform(transform, VARBINARY,\n                        block -> truncateVarbinary(block, width),\n                        (block, position) -> {\n                            if (block.isNull(position)) {\n                                return null;\n                            }\n                            return truncateVarbinary(VARBINARY.getSlice(block, position), width);\n                        });\n            }\n            throw new UnsupportedOperationException(\"Unsupported type for 'truncate': \" + field);\n        }\n\n        throw new UnsupportedOperationException(\"Unsupported partition transform: \" + field);\n    }\n\n    private static Block bucketInteger(Block block, int count)\n    {\n        return bucketBlock(block, count, position -> bucketHash(INTEGER.getLong(block, position)));\n    }\n\n    private static int bucketValueInteger(Block block, int position, int count)\n    {\n        return bucketValue(block, position, count, pos -> bucketHash(INTEGER.getLong(block, pos)));\n    }\n\n    private static Block bucketBigint(Block block, int count)\n    {\n        return bucketBlock(block, count, position -> bucketHash(BIGINT.getLong(block, position)));","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java#L279-L315","documentation":"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.","triggerScenarios":"Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java:297 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use truncate(w) only on supported types (strings, binaries, integrals)","Choose an appropriate transform for the column type or change 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"}