TyrantLucifer commented on code in PR #3896:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3896#discussion_r1071303288


##########
seatunnel-connectors-v2/connector-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/source/IoTDBSource.java:
##########
@@ -77,8 +77,13 @@ public void prepare(Config pluginConfig) throws 
PrepareFailException {
                 );
             }
         }
-        SeaTunnelSchema seatunnelSchema = 
SeaTunnelSchema.buildWithConfig(pluginConfig);
-        this.typeInfo = seatunnelSchema.getSeaTunnelRowType();
+        if (pluginConfig.hasPath(SeaTunnelSchema.SCHEMA.key())) {

Review Comment:
   Schema is a required key of connector, so if the user does not configured it 
connector should throw exception. You can refer to #3947. Thanks!



##########
seatunnel-connectors-v2/connector-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/source/IoTDBSource.java:
##########
@@ -77,8 +77,13 @@ public void prepare(Config pluginConfig) throws 
PrepareFailException {
                 );
             }
         }
-        SeaTunnelSchema seatunnelSchema = 
SeaTunnelSchema.buildWithConfig(pluginConfig);
-        this.typeInfo = seatunnelSchema.getSeaTunnelRowType();
+        if (pluginConfig.hasPath(SeaTunnelSchema.SCHEMA.key())) {
+            Config schemaConfig = 
pluginConfig.getConfig(SeaTunnelSchema.SCHEMA.key());
+            this.typeInfo = 
SeaTunnelSchema.buildWithConfig(schemaConfig).getSeaTunnelRowType();
+        } else {

Review Comment:
   Remove else branch.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to