You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/05/13 03:04:16 UTC

[GitHub] [dolphinscheduler] huangchenguang123 commented on a diff in pull request #10014: [fix-9991][worker]fix statement is closed before resultSet.getMetaData()

huangchenguang123 commented on code in PR #10014:
URL: https://github.com/apache/dolphinscheduler/pull/10014#discussion_r871962700


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -197,7 +198,9 @@ public void executeFuncAndSql(List<SqlBinds> mainStatementsBinds,
             // decide whether to executeQuery or executeUpdate based on sqlType
             if (sqlParameters.getSqlType() == SqlType.QUERY.ordinal()) {
                 // query statements need to be convert to JsonArray and inserted into Alert to send
-                resultSet = executeQuery(connection, mainStatementsBinds.get(0), "main");
+                statement = prepareStatementAndBind(connection, mainStatementsBinds.get(0));
+                logger.info("main statement execute query, for sql: {}", mainStatementsBinds.get(0).getSql());
+                resultSet = statement.executeQuery();

Review Comment:
   Its better to put the resultProcess method in the query method, i will fix my code.



-- 
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@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org