{"record":{"id":"59ab9db0900384f9","repo":"apache/seatunnel","slug":"unsupported-data-type-59ab9d","errorCode":"UNSUPPORTED_DATA_TYPE","errorMessage":"Not support to parse type: ${type}","messagePattern":"Not support to parse type: (.+?)","errorType":"error_code","errorClass":"MongodbConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/mongodb/serde/RowDataToBsonConverters.java","lineNumber":251,"sourceCode":"                        return new BsonDecimal128(\n                                new Decimal128(\n                                        Objects.requireNonNull(\n                                                fromBigDecimal(\n                                                        decimalVal,\n                                                        decimalType.getPrecision(),\n                                                        decimalType.getScale()))));\n                    }\n                };\n            case ARRAY:\n                return createArrayConverter((ArrayType<?, ?>) type);\n            case MAP:\n                MapType<?, ?> mapType = (MapType<?, ?>) type;\n                return createMapConverter(\n                        mapType.toString(), mapType.getKeyType(), mapType.getValueType());\n            case ROW:\n                return createRowConverter((SeaTunnelRowType) type);\n            default:\n                throw new MongodbConnectorException(\n                        UNSUPPORTED_DATA_TYPE, \"Not support to parse type: \" + type);\n        }\n    }\n\n    private static SerializableFunction<Object, BsonValue> createArrayConverter(\n            ArrayType<?, ?> arrayType) {\n        final SerializableFunction<Object, BsonValue> elementConverter =\n                createNullSafeInternalConverter(arrayType.getElementType());\n\n        return new SerializableFunction<Object, BsonValue>() {\n            private static final long serialVersionUID = 1L;\n\n            @Override\n            public BsonValue apply(Object value) {\n                Object[] arrayData = (Object[]) value;\n                final List<BsonValue> bsonValues = new ArrayList<>();\n                for (Object element : arrayData) {\n                    bsonValues.add(elementConverter.apply(element));","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/mongodb/serde/RowDataToBsonConverters.java#L233-L269","documentation":"createInternalConverter is the row-to-BSON type dispatcher in RowDataToBsonConverters; it supports NULL, boolean, numeric, string, bytes, array, map, and row types. Any other SeaTunnel type falling into the default branch (e.g. DATE/TIME variants not matched above, or custom types) is rejected with UNSUPPORTED_DATA_TYPE since there is no defined BSON representation.","triggerScenarios":"Writing a SeaTunnel table whose schema contains a type unsupported by the MongoDB BSON converter; createNullSafeInternalConverter delegates to createInternalConverter which hits the default case for that type.","commonSituations":"Schemas with DATE/TIME or other exotic types passed to the MongoDB sink after a schema change; auto-generated schemas from upstream sources containing types the connector never added converters for; copy-pasted sink definitions across connectors.","solutions":["Change the unsupported column to a supported type (INT/BIGINT/DOUBLE/DECIMAL/STRING/BYTES/BOOLEAN/ARRAY/MAP/ROW).","Pre-convert the column to a string or timestamp-compatible type in a transform before the sink.","Split the table so unsupported columns are written by a different connector.","If the type should be supported, extend createInternalConverter with a converter (contribute a fix)."],"exampleFix":"// before: schema uses a type with no BSON mapping\nSeaTunnelRowType.of(new String[]{\"ts\"}, new SeaTunnelDataType<?>[]{LocalTimeType.LOCAL_DATE_TIME})\n// after: cast to a supported type before the sink\nSeaTunnelRowType.of(new String[]{\"ts\"}, new SeaTunnelDataType<?>[]{StringType.INSTANCE}) // write ISO string","handlingStrategy":"validation","validationCode":"// pre-validate schema types are BSON-mappable\nSet<SqlType> supported = Set.of(BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DECIMAL, STRING, BYTES, ARRAY, MAP, ROW); // verify each field type before sink","typeGuard":null,"tryCatchPattern":"try { sink.write(row); } catch (MongodbConnectorException e) { if (e.getMessage().startsWith(\"Not support to parse type\")) { log.error(\"Schema contains unsupported type for MongoDB sink: \" + e.getMessage()); throw e; } throw e; }","preventionTips":["Restrict MongoDB sink schemas to connector-supported types","Cast unsupported types (e.g. DATE/TIME) to STRING in a transform stage first","Test the sink schema in a small batch job before production","Keep connector version current so newly supported types are available"],"tags":["mongodb","unsupported-type","schema","serde"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}