You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/08/03 14:05:21 UTC
[GitHub] [incubator-seatunnel] Hisoka-X commented on a diff in pull request #2356: Modify conversion error, new increase format match
Hisoka-X commented on code in PR #2356:
URL: https://github.com/apache/incubator-seatunnel/pull/2356#discussion_r936708498
##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-kafka/src/main/java/org/apache/seatunnel/flink/kafka/source/KafkaTableStream.java:
##########
@@ -110,8 +110,19 @@ public void prepare(FlinkEnvironment env) {
}
}
String schemaContent = config.getString(SCHEMA);
- format = FormatType.from(config.getString(SOURCE_FORMAT).trim().toLowerCase());
- schemaInfo = JsonUtils.parseArray(schemaContent);
+ String sourceFormat = config.getString(SOURCE_FORMAT).trim().toLowerCase();
+ format = FormatType.from(sourceFormat);
+ switch (sourceFormat){
+ case "csv":
+ schemaInfo = JsonUtils.parseArray(schemaContent);
+ break;
+ case "json":
+ case "avro":
+ schemaInfo = JsonUtils.parseObject(schemaContent);
Review Comment:
The method only support schema are object when use `json`. Can you support array in `json` schema both?
--
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-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org