njnu-seafish commented on code in PR #17702:
URL:
https://github.com/apache/dolphinscheduler/pull/17702#discussion_r2575531975
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java:
##########
@@ -248,11 +250,38 @@ private String resultProcess(ResultSet resultSet) throws
Exception {
int num = md.getColumnCount();
while (resultSet.next()) {
- ObjectNode mapOfColValues = JSONUtils.createObjectNode();
+ ObjectNode rowAsJson = JSONUtils.createObjectNode();
+ Set<String> usedLabels = new HashSet<>();
+
for (int i = 1; i <= num; i++) {
- mapOfColValues.set(md.getColumnLabel(i),
JSONUtils.toJsonNode(resultSet.getObject(i)));
+ // Get the column label (alias) from metadata; fall back
to a generic name if null or empty
Review Comment:
> Please remove unnessnary comment.
ok, done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]