{"record":{"id":"c6d6ff8fca3c9872","repo":"apache/iceberg","slug":"the-value-type-valuetype-is-not-yet-supported","errorCode":null,"errorMessage":"The value type '${valueType} is not yet supported inside for a subSchema.","messagePattern":"The value type '(.+?) is not yet supported inside for a subSchema\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"kafka-connect/kafka-connect-transforms/src/main/java/org/debezium/connector/mongodb/transforms/MongoDataConverter.java","lineNumber":435,"sourceCode":"          value\n              .asArray()\n              .forEach(f -> subSchema(documentSchemaBuilder, union, f.asDocument(), true));\n          if (documentSchemaBuilder.fields().isEmpty()) {\n            value\n                .asArray()\n                .forEach(f -> subSchema(documentSchemaBuilder, union, f.asDocument(), false));\n          }\n        } else {\n          subSchema(documentSchemaBuilder, union, value.asDocument(), false);\n        }\n        return documentSchemaBuilder.build();\n      case ARRAY:\n        BsonType subValueType = value.asArray().get(0).asArray().get(0).getBsonType();\n        return SchemaBuilder.array(subSchema(builder, key, subValueType, value.asArray().get(0)))\n            .optional()\n            .build();\n      default:\n        throw new IllegalArgumentException(\n            \"The value type '\" + valueType + \" is not yet supported inside for a subSchema.\");\n    }\n  }\n\n  private void subSchema(\n      SchemaBuilder documentSchemaBuilder,\n      Map<String, BsonType> union,\n      BsonDocument arrayDocs,\n      boolean emptyChecker) {\n    for (Entry<String, BsonValue> arrayDoc : arrayDocs.entrySet()) {\n      final String key = arrayDoc.getKey();\n      if (emptyChecker\n          && ((arrayDoc.getValue() instanceof BsonDocument\n                  && ((BsonDocument) arrayDoc.getValue()).isEmpty())\n              || (arrayDoc.getValue() instanceof BsonArray\n                  && ((BsonArray) arrayDoc.getValue()).isEmpty()))) {\n        continue;\n      }","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/kafka-connect/kafka-connect-transforms/src/main/java/org/debezium/connector/mongodb/transforms/MongoDataConverter.java#L417-L453","documentation":"MongoDataConverter.subSchema throws IllegalArgumentException when it encounters a BSON value type inside a nested sub-schema (e.g. inside arrays of documents) that the converter does not support. Only known BSON types are mapped to Connect schemas.","triggerScenarios":"Building the schema for an array-of-arrays (subSchema recursion) where the inner element's BsonType falls into the switch's default branch — e.g. exotic BSON types like DECIMAL128, TIMESTAMP, or binary in nested positions.","commonSituations":"MongoDB documents using newer BSON types (Decimal128, timestamps) inside nested arrays processed with array.encoding=struct.","solutions":["Convert the unsupported BSON type to a supported one (e.g. store decimals as strings) in MongoDB.","Use a different array.encoding setting (e.g. array encoding as JSON string) to avoid nested schema inference.","Restructure the document to avoid the unsupported type inside nested arrays."],"exampleFix":"// before\ndb.coll.insertOne({arr: [[Decimal128(\"1.2\")]]})\n// after\ndb.coll.insertOne({arr: [[\"1.2\"]]})","handlingStrategy":"validation","validationCode":"// Pre-scan nested array element BsonTypes against supported set\njava.util.Set<BsonType> supported = java.util.Set.of(BsonType.STRING, BsonType.INT32, BsonType.INT64, BsonType.DOUBLE, BsonType.BOOLEAN, BsonType.DOCUMENT, BsonType.ARRAY, BsonType.NULL);\nif (!supported.contains(innerElement.getBsonType())) throw new IllegalStateException(\"unsupported nested BSON type: \" + innerElement.getBsonType());","typeGuard":null,"tryCatchPattern":"try { ... } catch (IllegalArgumentException e) { log.error(\"Unsupported BSON type in sub-schema: {}\", e.getMessage()); }","preventionTips":["Avoid exotic BSON types (Decimal128, Timestamp) inside nested arrays","Prefer array.encoding=json for complex nested arrays","Add MongoDB schema validation to constrain field types"],"tags":["kafka-connect","debezium","mongodb","bson"],"backgroundTag":"unsupported-enum-value","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"}