zhuangchong commented on a change in pull request #5104:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/5104#discussion_r598062616
##########
File path:
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java
##########
@@ -269,15 +291,20 @@ private void resultProcess(ResultSet resultSet) throws
Exception{
rowCount++;
}
String result = JSONUtils.toJsonString(resultJSONArray);
- logger.debug("execute sql : {}", result);
+ logger.debug("execute sql result : {}", result);
+
+ int displayRows = sqlParameters.getDisplayRows() > 0 ?
sqlParameters.getDisplayRows() : Constants.DEFAULT_DISPLAY_ROWS;
+ displayRows = Math.min(displayRows, resultJSONArray.size());
+ logger.info("display sql result {} rows as follows:", displayRows);
+ for (int i = 0; i < displayRows; i++) {
+ String row = JSONUtils.toJsonString(resultJSONArray.get(i));
+ logger.info("row {} : {}", i + 1, row);
+ }
Review comment:
Variable LIMIT and sqlParameters getDisplayRows () should be the same,
please remove the variable LIMIT the relevant 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.
For queries about this service, please contact Infrastructure at:
[email protected]