{"record":{"id":"e2a59e216d4483f2","repo":"prestodb/presto","slug":"unsupported-partition-transform","errorCode":null,"errorMessage":"Unsupported partition transform: ","messagePattern":"Unsupported partition transform: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java","lineNumber":300,"sourceCode":"                                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)));\n    }\n\n    private static int bucketValueBigint(Block block, int position, int count)","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java#L282-L318","documentation":"PartitionTransforms.getColumnTransform maps an Iceberg partition field's transform (identity, year, month, day, hour, bucket, truncate) plus source type to an application function. When the transform name or the transform/type combination is not one of the supported cases, it throws UnsupportedOperationException. This is a code-level guard against partition specs the connector cannot evaluate.","triggerScenarios":"Querying or writing to an Iceberg table whose partition spec contains a transform the connector does not implement (e.g. void transform, bucket on a non-integer/long type, truncate on an unsupported type, or unknown transform strings from tables written by other engines/newer Iceberg versions).","commonSituations":"Tables created by Spark/Flink with exotic partition transforms being queried via Presto; partition evolution adding unsupported fields; truncate applied to types outside integer/long/string/varbinary.","solutions":["Identify the unsupported transform with: SELECT * FROM \"table$partitions\" or inspect the table's partition spec metadata and note the transform","Recreate or rewrite the table's partition spec using supported transforms: identity, year, month, day, hour, bucket[N], truncate[W] on supported types","If the transform is unsupported but the query doesn't need it, filter/partition pruning may still work — check whether the failing path is partition-pruning only and avoid features that evaluate the transform","Upgrade the Presto Iceberg connector version, as transform support grows over time"],"exampleFix":"// before (table created with unsupported transform)\nCREATE TABLE t (d DATE, v VARCHAR) WITH (partitioning = ARRAY['void(d)'])\n// after\nCREATE TABLE t (d DATE, v VARCHAR) WITH (partitioning = ARRAY['day(d)'])","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"identity\",\"year\",\"month\",\"day\",\"hour\",\"void\");\n// for each partition field, check transform name and source type compatibility before querying\nif (!supported.contains(transformName) && !(transformName.startsWith(\"bucket\") || transformName.startsWith(\"truncate\"))) {\n    throw new IllegalStateException(\"Unsupported partition transform: \" + transformName);\n}","typeGuard":"boolean isSupportedTransform(String transform) {\n    return transform != null && (Set.of(\"identity\",\"year\",\"month\",\"day\",\"hour\",\"void\").contains(transform)\n        || transform.matches(\"bucket\\\\(\\\\d+\\\\)\") || transform.matches(\"truncate\\\\[\\\\d+\\\\]\"));\n}","tryCatchPattern":"try { /* query table */ } catch (PrestoException e) {\n    if (\"Unsupported partition transform\".equals(e.getMessage())) { /* handle unsupported spec */ }\n    throw e;\n}","preventionTips":["Inspect the table's partition spec metadata before querying tables written by other engines","Restrict table creation to supported transforms (identity, year, month, day, hour, bucket, truncate)","Keep the Presto Iceberg connector updated for broader transform support","Avoid partition evolution features that introduce transforms not yet supported"],"tags":["iceberg","partitioning","unsupported-transform"],"backgroundTag":"unsupported-partition-transform","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"}