DongLiang-0 commented on code in PR #205: URL: https://github.com/apache/doris-flink-connector/pull/205#discussion_r1351219691
########## flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/JsonDebeziumSchemaSerializer.java: ########## @@ -453,13 +464,31 @@ public void fillOriginSchema(JsonNode columns) { private void buildFieldSchema(Map<String, FieldSchema> filedSchemaMap, JsonNode column) { String fieldName = column.get("name").asText(); - JsonNode length = column.get("length"); - JsonNode scale = column.get("scale"); - String type = MysqlType.toDorisType(column.get("typeName").asText(), - length == null ? 0 : length.asInt(), scale == null ? 0 : scale.asInt()); + int length = column.get("length") == null ? 0 : column.get("length").asInt(); + int scale = column.get("scale") == null ? 0 : column.get("scale").asInt(); + String sourceTypeName = column.get("typeName").asText(); + String dorisTypeName; + switch (sourceConnector) { + case MYSQL: + dorisTypeName = MysqlType.toDorisType(sourceTypeName, length, scale); + break; + case ORACLE: + dorisTypeName = OracleType.toDorisType(sourceTypeName, length, scale); + break; + case POSTGRES: + dorisTypeName = PostgresType.toDorisType(sourceTypeName, length, scale); + break; + case SQLSERVER: + dorisTypeName = SqlServerType.toDorisType(sourceTypeName, length, scale); + break; Review Comment: Of course! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org