{"record":{"id":"a668aeb8a6bff132","repo":"apache/iceberg","slug":"unsupported-element-type","errorCode":null,"errorMessage":"Unsupported element type: ","messagePattern":"Unsupported element type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java","lineNumber":341,"sourceCode":"            array[index] = convertValue(elementType.asListType().elementType(), element);\n          }\n\n          index += 1;\n        }\n        return new GenericArrayData(array);\n      case MAP:\n        Types.MapType mapType = elementType.asMapType();\n        Set<? extends Map.Entry<?, ?>> entries = ((Map<?, ?>) value).entrySet();\n        Map<Object, Object> result = Maps.newHashMap();\n        for (Map.Entry<?, ?> entry : entries) {\n          final Object keyValue = convertValue(mapType.keyType(), entry.getKey());\n          final Object valueValue = convertValue(mapType.valueType(), entry.getValue());\n          result.put(keyValue, valueValue);\n        }\n\n        return new GenericMapData(result);\n      default:\n        throw new UnsupportedOperationException(\"Unsupported element type: \" + elementType);\n    }\n  }\n}\n","sourceCodeStart":323,"sourceCodeEnd":345,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java#L323-L345","documentation":"StructRowData.convertValue maps Iceberg values to Flink container types and its switch covers primitive types, strings, records (RowData), arrays (GenericArrayData), and maps (GenericMapData). The default branch throws UnsupportedOperationException for any other element type, meaning the Iceberg type has no conversion case.","triggerScenarios":"convertValue is invoked with an elementType not handled by the switch, e.g. Variant or another newer Iceberg type when converting nested array/map/list values.","commonSituations":"Reading tables containing Variant or other newly added Iceberg types from Flink 2.3 jobs; nested arrays/maps of types the converter was not updated to handle.","solutions":["Upgrade the Iceberg Flink runtime to a version whose StructRowData handles the type shown in the message.","Avoid selecting unsupported columns (e.g. Variant) in Flink reads, or project around them.","Convert the unsupported type via an explicit SQL cast/expression to a supported type in the Flink job."],"exampleFix":"// before: selecting variant column directly\nSELECT my_variant FROM iceberg_table\n\n// after: cast or drop the unsupported column\nSELECT CAST(CAST(my_variant AS STRING) AS STRING) AS my_variant FROM iceberg_table","handlingStrategy":"validation","validationCode":"Types.StructType struct = schema.asStruct();\nfor (Types.NestedField f : schema.columns()) {\n  if (f.type().typeId() == Types.TypeID.VARIANT || f.type().typeId() == Types.TypeID.UNKNOWN) {\n    throw new IllegalArgumentException(\"Column \" + f.name() + \" type not supported by Flink converter\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  RowData row = ...;\n} catch (UnsupportedOperationException e) {\n  // fall back: drop or cast the unsupported column in the read projection\n}","preventionTips":["Check the Iceberg schema for Variant/unsupported types before running Flink reads.","Keep the Iceberg Flink runtime version aligned with the types used in tables.","Project only supported columns in Flink queries."],"tags":["flink","unsupported-operation","type-conversion"],"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"}