Browse Source

fix #2334 (#2335)

Co-authored-by: dailidong <dailidong66@gmail.com>
pull/2/head
Rubik-W 5 years ago committed by GitHub
parent
commit
4440b35c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sql/SqlTask.java

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

@ -299,8 +299,12 @@ public class SqlTask extends AbstractTask {
while (resultSet.next()) {
JSONObject mapOfColValues = new JSONObject(true);
for (int i = 1; i <= num; 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);
}
logger.debug("execute sql : {}", JSON.toJSONString(resultJSONArray, SerializerFeature.WriteMapNullValue));

Loading…
Cancel
Save