Browse Source

fix #2334 (#2335)

Co-authored-by: dailidong <dailidong66@gmail.com>
pull/3/MERGE
Rubik-W 5 years ago committed by gaojun2048
parent
commit
9b6ab81e60
  1. 6
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java

6
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java

@ -309,7 +309,11 @@ public class SqlTask extends AbstractTask {
while (resultSet.next()) { while (resultSet.next()) {
JSONObject mapOfColValues = new JSONObject(true); JSONObject mapOfColValues = new JSONObject(true);
for (int i = 1; i <= num; i++) { for (int i = 1; i <= num; i++) {
mapOfColValues.put(md.getColumnName(i), resultSet.getObject(i)); if (StringUtils.isNotEmpty(md.getColumnLabel(i))) {
mapOfColValues.put(md.getColumnLabel(i), resultSet.getObject(i));
} else {
mapOfColValues.put(md.getColumnName(i), resultSet.getObject(i));
}
} }
resultJSONArray.add(mapOfColValues); resultJSONArray.add(mapOfColValues);
} }

Loading…
Cancel
Save