{"record":{"id":"6d5e62e8d2ff3700","repo":"apache/seatunnel","slug":"unsupported-data-type-6d5e62","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/BsonToRowDataConverters.java","lineNumber":220,"sourceCode":"                    @Override\n                    public Object apply(BsonValue bsonValue) {\n                        DecimalType decimalType = (DecimalType) type;\n                        BigDecimal decimalValue = convertToBigDecimal(bsonValue);\n                        return fromBigDecimal(\n                                decimalValue, decimalType.getPrecision(), 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\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 LocalDateTime convertToLocalDateTime(BsonValue bsonValue) {\n        Instant instant;\n        if (bsonValue.isTimestamp()) {\n            instant = Instant.ofEpochMilli(bsonValue.asTimestamp().getValue());\n        } else if (bsonValue.isDateTime()) {\n            instant = Instant.ofEpochMilli(bsonValue.asDateTime().getValue());\n        } else {\n            throw new MongodbConnectorException(\n                    ILLEGAL_ARGUMENT,\n                    \"Unable to convert to LocalDateTime from unexpected value '\"\n                            + bsonValue\n                            + \"' of type \"\n                            + bsonValue.getBsonType());\n        }","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/mongodb/serde/BsonToRowDataConverters.java#L202-L238","documentation":"BsonToRowDataConverters.createInternalConverter builds a BsonValue->Object converter per SeaTunnel column type. When the target column's SqlType falls through the switch (no case matches, e.g. NULL_TYPE, TIME, or any type added to SeaTunnel but not handled here), it throws MongodbConnectorException(UNSUPPORTED_DATA_TYPE, \"Not support to parse type: \" + type). It is thrown at converter-construction time (job startup/schema resolution), not per document.","triggerScenarios":"Defining a MongoDB source table schema whose column type has a SqlType not in the switch (e.g. TIME, NULL_TYPE, or a newly introduced SeaTunnel SqlType), so createNullSafeInternalConverter -> createInternalConverter hits the default branch.","commonSituations":"Users declaring a schema with an exotic column type (time, unsupported variants) in a SeaTunnel config against MongoDB; upgrading SeaTunnel where a new SqlType exists in the catalog but the MongoDB serde was not extended.","solutions":["Change the column type in your schema/config to a supported SqlType (STRING, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DECIMAL, BYTES, DATE, TIMESTAMP, ARRAY, MAP, ROW).","Pre-convert the field in the query or upstream pipeline so it lands as a supported type.","If you own the code, add a case to the switch in createInternalConverter implementing a converter for the missing SqlType.","Check your SeaTunnel version; upgrade to one where the MongoDB connector supports the type you need."],"exampleFix":"// before\ncolumns {\n  created_at = TIME\n}\n// after\ncolumns {\n  created_at = TIMESTAMP\n}","handlingStrategy":"validation","validationCode":"// Before submitting the job, check every declared column type is supported by the MongoDB serde\njava.util.Set<SqlType> supported = new java.util.HashSet<>(java.util.Arrays.asList(\n    SqlType.STRING, SqlType.BOOLEAN, SqlType.TINYINT, SqlType.SMALLINT, SqlType.INT,\n    SqlType.BIGINT, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL, SqlType.BYTES,\n    SqlType.DATE, SqlType.TIMESTAMP, SqlType.ARRAY, SqlType.MAP, SqlType.ROW));\nfor (SeaTunnelDataType<?> t : rowType.getFieldTypes()) {\n    if (!supported.contains(t.getSqlType())) {\n        throw new IllegalArgumentException(\"Unsupported column type for MongoDB source: \" + t);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    runJob(config);\n} catch (MongodbConnectorException e) {\n    if (\"UNSUPPORTED_DATA_TYPE\".equals(String.valueOf(e.getSeaTunnelErrorCode()))) {\n        // adjust schema column types and resubmit\n    } else { throw e; }\n}","preventionTips":["Only declare column types from the MongoDB connector's documented supported list","Avoid TIME and other exotic SqlTypes in schemas read from MongoDB","After SeaTunnel upgrades, re-check that all schema types are still handled by the connector"],"tags":["mongodb","sea-tunnel","serde","unsupported-data-type","schema"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}