{"record":{"id":"25310196ea7fc365","repo":"prestodb/presto","slug":"invalid-partition-field-declaration","errorCode":null,"errorMessage":"Invalid partition field declaration: ","messagePattern":"Invalid partition field declaration: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionFields.java","lineNumber":112,"sourceCode":"            buildPartitionSpec(builder, field);\n        }\n        return builder.build();\n    }\n\n    @VisibleForTesting\n    static void buildPartitionField(PartitionSpec.Builder builder, String field)\n    {\n        @SuppressWarnings(\"PointlessBooleanExpression\")\n        boolean matched = false ||\n                tryMatch(field, IDENTITY_PATTERN, match -> builder.identity(match.group())) ||\n                tryMatch(field, YEAR_PATTERN, match -> builder.year(match.group(1))) ||\n                tryMatch(field, MONTH_PATTERN, match -> builder.month(match.group(1))) ||\n                tryMatch(field, DAY_PATTERN, match -> builder.day(match.group(1))) ||\n                tryMatch(field, HOUR_PATTERN, match -> builder.hour(match.group(1))) ||\n                tryMatch(field, BUCKET_PATTERN, match -> builder.bucket(match.group(1), parseInt(match.group(2)))) ||\n                tryMatch(field, TRUNCATE_PATTERN, match -> builder.truncate(match.group(1), parseInt(match.group(2))));\n        if (!matched) {\n            throw new IllegalArgumentException(\"Invalid partition field declaration: \" + field);\n        }\n    }\n\n    private static void buildPartitionSpec(PartitionSpec.Builder builder, IcebergPartitionField partitionField)\n    {\n        String field = partitionField.getName();\n        PartitionTransformType type = partitionField.getTransform();\n        OptionalInt parameter = partitionField.getParameter();\n        switch (type) {\n            case IDENTITY:\n                builder.identity(field);\n                break;\n            case YEAR:\n                builder.year(field);\n                break;\n            case MONTH:\n                builder.month(field);\n                break;","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionFields.java#L94-L130","documentation":"PartitionFields.buildPartitionField matches each partition-field declaration against known transform patterns (identity, year, month, day, hour, bucket, truncate); if no pattern matches the field string, a PrestoException with this message and the raw declaration is raised, indicating a syntactically invalid partition spec entry in DDL or table properties.","triggerScenarios":"Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionFields.java:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the partition field syntax, e.g. identity(col), year(col), bucket(n, col), truncate(w, col)","Check for typos or unsupported transform names in the partitioned_by/spec declaration"],"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"}