exceptionfactory commented on code in PR #6853:
URL: https://github.com/apache/nifi/pull/6853#discussion_r1072351355


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractExecuteSQL.java:
##########
@@ -273,10 +274,21 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
                     throw failure.getRight();
                 }
 
+                final Map<String, String> sqlParameters = 
context.getProperties()
+                        .entrySet()
+                        .stream()
+                        .filter(e -> e.getKey().isDynamic())
+                        .collect(Collectors.toMap(e -> e.getKey().getName(), 
Map.Entry::getValue));
+
                 if (fileToProcess != null) {
-                    JdbcCommon.setParameters(st, 
fileToProcess.getAttributes());
+                    sqlParameters.putAll(fileToProcess.getAttributes());
+                }
+
+                if (!sqlParameters.isEmpty()) {
+                    JdbcCommon.setParameters(st, sqlParameters);

Review Comment:
   The `JdbcCommon.setParameters()` method logs parameter values and includes 
the parameter value in some exception messages, which is a problem for 
sensitive properties.



-- 
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]

Reply via email to