{"record":{"id":"f834aba2a7c05968","repo":"apache/iceberg","slug":"not-a-supported-type-targettype-f834ab","errorCode":null,"errorMessage":"Not a supported type: ${targetType}","messagePattern":"Not a supported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/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/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DataConverter.java#L109-L145","documentation":"DataConverter.get() builds a converter for pairs of Flink logical types but only supports RowType, ArrayType, and MapType at the top level. Any other LogicalType (e.g. raw VARBINARY used here, or unsupported roots) hits the default branch and raises UnsupportedOperationException.","triggerScenarios":"Calling the dynamic sink's DataConverter.get(sourceType, targetType) where targetType's root logical type is not ROW, ARRAY, or MAP — e.g. a top-level column type of BINARY/VARBINARY or a custom logical type.","commonSituations":"Schema evolution where a field's type changed into an unsupported category; users feeding non-row-rooted types into the dynamic sink's schema-compatibility machinery.","solutions":["Ensure the evolving field types are restricted to ROW, ARRAY, or MAP structures supported by the dynamic sink.","If a type was evolved to an unsupported one, roll back the schema change or add an explicit case to DataConverter.get for that type.","Pre-transform data so the target field uses a supported type before writing."],"exampleFix":"// before: target field type = VARBINARY\n// after: keep the field as BINARY<->BYTES compatible or wrap in a supported structure\nALTER TABLE db.t MODIFY COLUMN payload BYTES; // if BYTES<->VARBINARY handled upstream, else avoid this evolution","handlingStrategy":"validation","validationCode":"LogicalType root = targetType;\nif (!(root instanceof RowType || root instanceof ArrayType || root instanceof MapType)) {\n  throw new IllegalArgumentException(\"Dynamic sink only supports ROW/ARRAY/MAP roots, got: \" + root);\n}","typeGuard":"static boolean isSupportedRoot(LogicalType t) {\n  return t instanceof RowType || t instanceof ArrayType || t instanceof MapType;\n}","tryCatchPattern":null,"preventionTips":["Restrict schema evolution to supported type categories (row/array/map).","Test schema changes on a staging table before applying to production."],"tags":["flink","dynamic-sink","schema","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-14T16:17:12.679Z"}