{"record":{"id":"a4687ea5b6ca1875","repo":"apache/iceberg","slug":"unsupported-element-type-elementtype","errorCode":null,"errorMessage":"Unsupported element type: ${elementType}","messagePattern":"Unsupported element type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java","lineNumber":335,"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":317,"sourceCodeEnd":339,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/StructRowData.java#L317-L339","documentation":"StructRowData.convertValue recursively converts Iceberg field values into Flink ArrayData/MapData-compatible objects. The default branch means a LogicalType of a nested element was not one of the handled types (primitives, VARCHAR, TIMESTAMP, ARRAY, MAP, ROW, etc.), so the adapter cannot interpret the stored value and throws UnsupportedOperationException.","triggerScenarios":"Reading an Iceberg table whose nested array/map element type maps to a Flink LogicalType not handled by convertValue (e.g. a newly added or exotic logical type) via getArray/getMap on StructRowData.","commonSituations":"New Iceberg/Flink type support (e.g. nanosecond timestamps or variant types) used with an older flink runtime adapter that lacks the case; nested types inside array/map columns.","solutions":["Check the elementType in the message against the supported types in convertValue and avoid/normalize that nested type in the schema if possible.","Upgrade the iceberg-flink runtime module to a version that handles the nested element type.","If the type should be supported, add a case to convertValue mirroring the existing conversion pattern for the missing LogicalType."],"exampleFix":"// before\ndefault:\n  throw new UnsupportedOperationException(\"Unsupported element type: \" + elementType);\n// after\ncase TIMESTAMP_WITHOUT_TIME_ZONE:\n  return TimestampData.fromEpochMillis(...);\ndefault:\n  throw new UnsupportedOperationException(\"Unsupported element type: \" + elementType);","handlingStrategy":"validation","validationCode":"// validate schema before reading\nRowType rowType = FlinkSchemaUtil.convert(table.schema());\nrowType.getFields().forEach(f -> checkSupportedNested(f.getType()));","typeGuard":"boolean isConvertible(LogicalType t) { return t instanceof IntType || t instanceof BigIntType || t instanceof VarCharType || t instanceof TimestampType || t instanceof RowType || t instanceof ArrayType || t instanceof MapType; }","tryCatchPattern":"try { return rowData.getArray(pos); } catch (UnsupportedOperationException e) { log.error(\"Nested element type unsupported: {}\", e.getMessage()); throw e; }","preventionTips":["Check nested array/map element types against convertValue's supported cases before reading","Upgrade iceberg-flink when using newly introduced Iceberg types","Avoid exotic nested types in schemas consumed by Flink readers"],"tags":["flink","nested-types","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}