{"record":{"id":"5cda13e2db8abbd1","repo":"apache/beam","slug":"s-at-key-s-is-not-supported","errorCode":null,"errorMessage":"%s at key %s is not supported","messagePattern":"(.+?) at key (.+?) is not supported","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/file-schema-transform/src/main/java/org/apache/beam/sdk/io/fileschematransform/XmlRowValue.java","lineNumber":136,"sourceCode":"      case INT32:\n      case INT64:\n      case STRING:\n        primitiveValue = parent.getValue(key);\n        return;\n      case ARRAY:\n      case ITERABLE:\n        setArrayValue(key, field, parent);\n        return;\n      case DATETIME:\n        setDateTimeValue(key, parent);\n        return;\n      case ROW:\n        Optional<Row> child = Optional.ofNullable(parent.getRow(key));\n        checkState(child.isPresent());\n        setNestedValue(child.get());\n        return;\n      default:\n        throw new IllegalArgumentException(\n            String.format(\"%s at key %s is not supported\", typeName.name(), key));\n    }\n  }\n\n  private void setArrayValue(String key, Field field, Row parent) {\n    Optional<FieldType> collectionFieldType =\n        Optional.ofNullable(field.getType().getCollectionElementType());\n    checkState(collectionFieldType.isPresent());\n    TypeName collectionFieldTypeName = collectionFieldType.get().getTypeName();\n    Optional<Iterable<Object>> iterable = Optional.ofNullable(parent.getIterable(key));\n    checkState(iterable.isPresent());\n    valueList = new ArrayList<>();\n    Optional<ArrayList<XmlRowValue>> safeValueList = Optional.of(valueList);\n\n    switch (collectionFieldTypeName) {\n      case BOOLEAN:\n      case BYTE:\n      case DECIMAL:","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/file-schema-transform/src/main/java/org/apache/beam/sdk/io/fileschematransform/XmlRowValue.java#L118-L154","documentation":"XmlRowValue.setValue walks a Beam Row to emit XML and, upon encountering a field type it cannot represent in XML (an unsupported FieldType TypeName), throws IllegalArgumentException naming the type and key. The XML sink supports only the primitive/row/array/datetime cases handled before the default branch.","triggerScenarios":"Writing a schema containing an unsupported field type (e.g. MAP or other non-primitive nested type at a top-level or nested key) through the XML file-schema-transform sink.","commonSituations":"Schemas evolved to add MAP fields; reusing a generic Row schema written for Avro/Parquet with the XML sink.","solutions":["Remove or flatten the unsupported field type from the schema","Convert MAP (or other unsupported) fields into repeated ROWs before writing","Choose a format that supports the type (Parquet/Avro) instead of XML"],"exampleFix":"// before\nSchema with MAP field passed to XML sink\n// after\nrow.getArray(\"my_map_entries\") // pre-transform MAP into ARRAY<ROW<key,value>> before the XML sink","handlingStrategy":"validation","validationCode":"for (Field f : row.getSchema().getFields()) { if (f.getType().getTypeName() == TypeName.MAP) throw new IllegalStateException(\"field \" + f.getName() + \" unsupported by XML sink\"); }","typeGuard":"boolean xmlWritable(Schema s) { return s.getFields().stream().allMatch(f -> f.getType().getTypeName() != TypeName.MAP); }","tryCatchPattern":"try { applyXmlSink(row); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"is not supported\")) { convertSchemaAndRetry(row); } else throw e; }","preventionTips":["Validate schemas against supported XML types before building pipelines","Flatten MAP types upstream"],"tags":["java","apache-beam","xml","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}