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/17 06:52:20 UTC

[GitHub] [incubator-seatunnel] Hisoka-X commented on a diff in pull request #2439: [Improve][Connector-V2] Http source support user-defined schema

Hisoka-X commented on code in PR #2439:
URL: https://github.com/apache/incubator-seatunnel/pull/2439#discussion_r947515390


##########
seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/source/HttpSource.java:
##########
@@ -57,13 +60,22 @@ public Boundedness getBoundedness() {
 
     @Override
     public void prepare(Config pluginConfig) throws PrepareFailException {
-        CheckResult result = CheckConfigUtil.checkAllExists(pluginConfig, HttpConfig.URL);
+        CheckResult result = CheckConfigUtil.checkAllExists(pluginConfig, HttpConfig.URL, HttpConfig.SCHEMA);
         if (!result.isSuccess()) {
             throw new PrepareFailException(getPluginName(), PluginType.SOURCE, result.getMsg());
         }
         this.httpParameter.buildWithConfig(pluginConfig);
-        // TODO support user custom row type
-        this.rowType = new SeaTunnelRowType(new String[]{"content"}, new SeaTunnelDataType<?>[]{BasicType.STRING_TYPE});
+        Config schema = pluginConfig.getConfig(HttpConfig.SCHEMA);
+        this.rowType = SeatunnelSchema.buildWithConfig(schema).getSeaTunnelRowType();
+        String format;

Review Comment:
   Seem like your remove text format, please add it back, so it can support json and text 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