chengshiwen commented on a change in pull request #5104:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/5104#discussion_r598066477
##########
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:
The variable `LIMIT` is different from `displayRows`, and the latter one
is used to print in the log for users to view.
--
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]