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 00:46:28 UTC

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

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


##########
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:
   I do not recommend this modification. You can put the resultProcess method in the query method, and the close method only has connection as an input parameter.



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