{"record":{"id":"e9b4073c1bdcb3c0","repo":"apache/iceberg","slug":"not-a-supported-type-targettype","errorCode":null,"errorMessage":"Not a supported type: ${targetType}","messagePattern":"Not a supported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DataConverter.java","lineNumber":127,"sourceCode":"        };\n      case TIMESTAMP_WITHOUT_TIME_ZONE:\n        return object -> {\n          if (object instanceof Integer) {\n            LocalDateTime dateTime =\n                LocalDateTime.of(LocalDate.ofEpochDay((Integer) object), LocalTime.MIN);\n            return TimestampData.fromLocalDateTime(dateTime);\n          } else {\n            return object;\n          }\n        };\n      case ROW:\n        return new RowDataConverter((RowType) sourceType, (RowType) targetType);\n      case ARRAY:\n        return new ArrayConverter((ArrayType) sourceType, (ArrayType) targetType);\n      case MAP:\n        return new MapConverter((MapType) sourceType, (MapType) targetType);\n      default:\n        throw new UnsupportedOperationException(\"Not a supported type: \" + targetType);\n    }\n  }\n\n  static DataConverter nullable(DataConverter converter) {\n    return value -> value == null ? null : converter.convert(value);\n  }\n\n  class RowDataConverter implements DataConverter {\n    private final RowData.FieldGetter[] fieldGetters;\n    private final DataConverter[] dataConverters;\n\n    RowDataConverter(RowType sourceType, RowType targetType) {\n      this.fieldGetters = new RowData.FieldGetter[targetType.getFields().size()];\n      this.dataConverters = new DataConverter[targetType.getFields().size()];\n\n      for (int i = 0; i < targetType.getFields().size(); i++) {\n        RowData.FieldGetter fieldGetter;\n        DataConverter dataConverter;","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DataConverter.java#L109-L145","documentation":"DataConverter.get() dispatches on the root Flink LogicalType of the source/target pair and only supports ROW, ARRAY, and MAP roots when building converters. Any other top-level type (or an unhandled case) falls into the default branch and throws UnsupportedOperationException naming the offending type. Row-level primitive types are handled at the field level elsewhere, so hitting this means an unexpected root type reached the converter factory.","triggerScenarios":"Calling DataConverter.get(sourceType, targetType) with a root LogicalType other than ROW, ARRAY, or MAP (e.g. a bare IntType, VarCharType, or an unsupported composite type).","commonSituations":"A table schema change reduced the row to something the dynamic sink's converter dispatch does not handle; an upstream refactor passes a flattened column type instead of a RowType; a new Flink type family not yet covered by the switch.","solutions":["Ensure the types passed to DataConverter.get() are RowType-based (full table rows), not bare primitive types","Add a case to the switch in DataConverter.get() if the new root type genuinely needs support","Log/inspect the targetType value in the message to identify which unexpected type is flowing in"],"exampleFix":"// before\nDataConverter.get(rowDataType, intType); // throws\n// after\nDataConverter.get(sourceRowType, targetRowType);","handlingStrategy":"type-guard","validationCode":"if (!(sourceType instanceof RowType)) {\n  throw new IllegalArgumentException(\"Expected RowType root, got: \" + sourceType);\n}","typeGuard":"boolean isSupportedRoot(LogicalType t) {\n  switch (t.getTypeRoot()) {\n    case ROW:\n    case ARRAY:\n    case MAP:\n      return true;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try {\n  converter = DataConverter.get(sourceType, targetType);\n} catch (UnsupportedOperationException e) {\n  // handle unsupported root type: log targetType and fall back / fail fast\n}","preventionTips":["Always pass full RowType table rows into the dynamic sink converters","Check the sink's supported root types before feeding new Flink logical types","Add a switch case + test when introducing support for a new root type"],"tags":["flink","type-system","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}