{"record":{"id":"45b85eb1517d32a6","repo":"apache/iceberg","slug":"unsupported-transform-transform","errorCode":null,"errorMessage":"Unsupported transform: ${transform}","messagePattern":"Unsupported transform: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/SchemaUtils.java","lineNumber":198,"sourceCode":"                break;\n              case \"hour\":\n              case \"hours\":\n                specBuilder.hour(matcher.group(2));\n                break;\n              case \"bucket\":\n                {\n                  Pair<String, Integer> args = transformArgPair(matcher.group(2));\n                  specBuilder.bucket(args.first(), args.second());\n                  break;\n                }\n              case \"truncate\":\n                {\n                  Pair<String, Integer> args = transformArgPair(matcher.group(2));\n                  specBuilder.truncate(args.first(), args.second());\n                  break;\n                }\n              default:\n                throw new UnsupportedOperationException(\"Unsupported transform: \" + transform);\n            }\n          } else {\n            specBuilder.identity(partitionField);\n          }\n        });\n    return specBuilder.build();\n  }\n\n  private static Pair<String, Integer> transformArgPair(String argsStr) {\n    List<String> parts = Splitter.on(',').splitToList(argsStr);\n    if (parts.size() != 2) {\n      throw new IllegalArgumentException(\"Invalid argument \" + argsStr + \", should have 2 parts\");\n    }\n    return Pair.of(parts.get(0).trim(), Integer.parseInt(parts.get(1).trim()));\n  }\n\n  static Type toIcebergType(Schema valueSchema, IcebergSinkConfig config) {\n    return new SchemaGenerator(config).toIcebergType(valueSchema);","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/SchemaUtils.java#L180-L216","documentation":"createPartitionSpec parses partition expressions like \"days(ts)\", \"truncate(col,10)\" from the iceberg.partition-by config. Recognized transforms are identity (no parens), year/month/day/hour, bucket, and truncate; anything else inside the parentheses throws UnsupportedOperationException.","triggerScenarios":"Setting iceberg.partition-by to a transform Iceberg's supported set doesn't include here, e.g. \"date(col)\", \"decade(col)\", \"substr(col,1,3)\".","commonSituations":"Config copied from Hive/Spark dialects with unsupported function names; typo like 'dayz' or 'timestampdays' (legacy naming).","solutions":["Use supported transforms: identity (bare column), years/months/days/hours, bucket[N](col), truncate[W](col).","Replace legacy Hive names (e.g. 'date(ts)') with Iceberg 'days(ts)'.","Fix typos in the partition-by configuration."],"exampleFix":"// before\n\"iceberg.partition-by\": \"date(event_time)\"\n// after\n\"iceberg.partition-by\": \"days(event_time)\"","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"identity\",\"year\",\"years\",\"month\",\"months\",\"day\",\"days\",\"hour\",\"hours\",\"bucket\",\"truncate\");\nfor (String p : partitionBy.split(\",\")) {\n  String t = p.contains(\"(\") ? p.substring(0, p.indexOf('(')) : p.trim();\n  if (!allowed.contains(t.toLowerCase(Locale.ROOT)))\n    throw new ConfigException(\"Unsupported transform: \" + t);\n}","typeGuard":null,"tryCatchPattern":"try { spec = SchemaUtils.createPartitionSpec(schema, partitionBy); }\ncatch (UnsupportedOperationException e) { throw new ConfigException(\"Bad partition-by: \" + e.getMessage(), e); }","preventionTips":["Use only Iceberg transforms: years/months/days/hours/bucket/truncate/identity","Replace Hive-style names like date(ts) with days(ts)","Validate partition-by config before deploying the connector"],"tags":["kafka-connect","partitioning","transform"],"backgroundTag":"invalid-argument-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}