ruanwenjun commented on code in PR #18080:
URL:
https://github.com/apache/dolphinscheduler/pull/18080#discussion_r2963556895
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-dinky/src/main/java/org/apache/dolphinscheduler/plugin/task/dinky/DinkyTask.java:
##########
@@ -339,24 +337,22 @@ public void cancelApplication() throws TaskException {
private Map<String, String> generateVariables() {
Map<String, String> variables = new ConcurrentHashMap<>();
- List<Property> propertyList =
-
GlobalParameterUtils.deserializeGlobalParameter(taskExecutionContext.getGlobalParams());
- if (propertyList != null && !propertyList.isEmpty()) {
- for (Property property : propertyList) {
- variables.put(property.getProp(), property.getValue());
+ Map<String, Property> prepareParamsMap =
taskExecutionContext.getPrepareParamsMap();
+ prepareParamsMap.forEach((key, property) -> {
+ if (property != null && property.getValue() != null) {
+ variables.put(key, property.getValue().trim());
}
- }
+ });
List<Property> localParams = this.dinkyParameters.getLocalParams();
- Map<String, Property> prepareParamsMap =
taskExecutionContext.getPrepareParamsMap();
- if (localParams == null || localParams.isEmpty()) {
- return variables;
- }
- Map<String, String> convertMap =
ParameterUtils.convert(prepareParamsMap);
- for (Property property : localParams) {
- String propertyValue = property.getValue();
- String value = PlaceholderUtils.replacePlaceholders(propertyValue,
convertMap, true);
- variables.put(property.getProp(), value);
+ if (localParams != null) {
+ for (Property property : localParams) {
+ String value =
ParameterUtils.convertParameterPlaceholders(property.getValue(), variables);
+ if (value != null && !value.isEmpty()) {
+ variables.put(property.getProp(), value.trim());
+ }
+ }
}
+ log.info("sending variables to dinky: {}", variables);
Review Comment:
Are you sure? please test it on dev branch, this should be handled at master
server.
--
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]