mgaido91 commented on a change in pull request #3615: NIFI-6500 Support Padding
functions in Expression Language
URL: https://github.com/apache/nifi/pull/3615#discussion_r309695301
##########
File path:
nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/compile/ExpressionCompiler.java
##########
@@ -652,6 +656,28 @@ private DateEvaluator toDateEvaluator(final Evaluator<?>
evaluator, final String
toStringEvaluator(argEvaluators.get(0), "first argument to
replaceAll"),
toStringEvaluator(argEvaluators.get(1), "second argument
to replaceAll")), "replaceAll");
}
+ case PAD_LEFT: {
+ if (argEvaluators.size() == 1) {
+ return addToken(new
PadLeftEvaluator(toStringEvaluator(subjectEvaluator),
+ toWholeNumberEvaluator(argEvaluators.get(0), "desired
string length")),
+ "padLeft");
+ } else {
+ return addToken(new
PadLeftEvaluator(toStringEvaluator(subjectEvaluator),
+ toWholeNumberEvaluator(argEvaluators.get(0), "desired
string length"),
+ toStringEvaluator(argEvaluators.get(1), "padding
character")), "padLeft");
Review comment:
nit:
```suggestion
toStringEvaluator(argEvaluators.get(1), "padding
string")), "padLeft");
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services