shashwatsai commented on code in PR #233:
URL: https://github.com/apache/seatunnel-web/pull/233#discussion_r1808758318


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/thirdparty/datasource/impl/Db2DataSourceConfigSwitcher.java:
##########
@@ -110,13 +110,15 @@ public Config mergeDatasourceConfig(
                 connectorConfig =
                         connectorConfig.withValue(QUERY_KEY, 
ConfigValueFactory.fromAnyRef(sql));
             } else if (pluginType.equals(PluginType.SINK)) {
-
-                List<String> tableFields = selectTableFields.getTableFields();
-
-                String sql = generateDb2(tableFields, databaseName, tableName);
-
-                connectorConfig =
-                        connectorConfig.withValue(QUERY_KEY, 
ConfigValueFactory.fromAnyRef(sql));
+                if (selectTableFields.isAll()) {
+                    // Convert schema to SQL if all fields are present
+                    // else use default generate_sink_sql=true
+                    List<String> tableFields = 
selectTableFields.getTableFields();
+                    String sql = generateDb2(tableFields, databaseName, 
tableName);
+                    connectorConfig =
+                            connectorConfig.withValue(
+                                    QUERY_KEY, 
ConfigValueFactory.fromAnyRef(sql));
+                }

Review Comment:
   Done @arshadmohammad! 
   
   Thanks for your time, have incorporated the review comments.  



-- 
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