{"record":{"id":"eeeaf79974a1b424","repo":"apache/beam","slug":"type-s-of-field-s-is-unknown","errorCode":null,"errorMessage":"Type %s of field %s is unknown.","messagePattern":"Type (.+?) of field (.+?) is unknown\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/schemas/AwsTypes.java","lineNumber":92,"sourceCode":"          .build();\n\n  private static FieldType fieldType(SdkField<?> field, Set<Class<?>> seen) {\n    MarshallingType<?> type = field.marshallingType();\n    if (type == LIST) {\n      return FieldType.array(fieldType(elementField(field), seen));\n    } else if (type == MAP) {\n      return FieldType.map(FieldType.STRING, fieldType(valueField(field), seen));\n    } else if (type == SDK_POJO) {\n      SdkPojo builder = field.constructor().get();\n      Class<?> clazz = targetClassOf(builder);\n      checkState(!seen.contains(clazz), \"Self-recursive types are not supported: %s\", clazz);\n      return FieldType.row(schemaFor(builder.sdkFields(), Sets.union(seen, singleton(clazz))));\n    }\n    FieldType fieldType = typeMapping.get(type);\n    if (fieldType != null) {\n      return fieldType;\n    }\n    throw new RuntimeException(\n        String.format(\"Type %s of field %s is unknown.\", type, normalizedNameOf(field)));\n  }\n\n  static FieldValueTypeInformation fieldValueTypeInformationFor(SdkField<?> sdkField) {\n    TypeDescriptor<?> type = TypeDescriptor.of(sdkField.marshallingType().getTargetClass());\n    return FieldValueTypeInformation.builder()\n        .setName(normalizedNameOf(sdkField))\n        .setType(type)\n        .setRawType(sdkField.marshallingType().getClass())\n        .setElementType(FieldValueTypeInformation.getIterableComponentType(type))\n        .setMapKeyType(FieldValueTypeInformation.getMapKeyType(type))\n        .setMapValueType(FieldValueTypeInformation.getMapValueType(type))\n        .setOneOfTypes(Collections.emptyMap())\n        .setNullable(true)\n        .build();\n  }\n\n  private static Schema schemaFor(List<SdkField<?>> fields, Set<Class<?>> seen) {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/schemas/AwsTypes.java#L74-L110","documentation":"AwsTypes.fieldType maps AWS SDK marshalling types to Beam FieldTypes; when it encounters a type outside its mapping table it throws RuntimeException 'Type %s of field %s is unknown.' This means the AWS SDK field's marshalling type has no Beam schema representation in this version.","triggerScenarios":"Schema-for-ing an AWS SDK POJO containing a field whose MarshallingType has no mapping in AwsTypes.typeMapping (e.g. certain streaming/blob/document types); recursive fieldType/schemaFor traversal hitting an unmapped nested type.","commonSituations":"Newer AWS SDK versions introduce new marshalling types not yet mapped in the Beam version in use; using AwsSchemaProvider on POJOs with unusual field types.","solutions":["Upgrade Apache Beam so AwsTypes knows the new marshalling type","Check the field type and exclude/flatten that field before schema conversion","Contribute a typeMapping entry via a custom schema provider subclass"],"exampleFix":"// before\nSchema s = AwsSchemaUtils.schemaFor(UnsupportedAwsPojo.class);\n// after\nSchema s = Schema.builder()\n    .addStringField(\"supportedField\")\n    // build only from fields with supported marshalling types\n    .build();","handlingStrategy":"validation","validationCode":"for (SdkField<?> f : pojo.sdkFields()) { /* check f.marshallingType() is one of AwsTypes.typeMapping keys before schemaFor */ }","typeGuard":null,"tryCatchPattern":"try { Schema s = AwsSchemaUtils.schemaFor(MyPojo.class); } catch (RuntimeException e) { /* fall back to manual field mapping */ }","preventionTips":["Keep Beam and AWS SDK v2 versions aligned","Pin AWS SDK versions known to work with your Beam AWS2 module version","Test schemaFor on all POJOs you feed into the pipeline"],"tags":["java","schemas","type-mapping"],"backgroundTag":"type-mismatch","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"}