[ 
https://issues.apache.org/jira/browse/NIFI-14076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joby Joje updated NIFI-14076:
-----------------------------
    Description: 
Hey Team,

I am trying to use an Expression Language in the JoinEnrichment processor, to 
generate the date on the fly when running the SQL

SQL property on JoinEnrichment
{code:java}
SELECT original.*, '${now():format("yyyy-MM-dd HH:mm:ss", "Europe/Paris")}' AS 
Dateval FROM original WHERE record_id NOT IN (SELECT record_id FROM 
enrichment){code}
This gives me an output as follows without actually evaluating the expression 
language
{code:java}
[ { "record_id" : "DUMMY--2", "mode_completion" : "2", "Dateval" : 
"${now():format(\"yyyy-MM-dd HH:mm:ss\", \"Europe/Paris\")}" } ]{code}
When I run the same on QueryRecord processor
{code:java}
SELECT *, '${now():format("yyyy-MM-dd HH:mm:ss", "Europe/Paris")}' AS Dateval 
FROM FLOWFILE{code}
I get the expression language in the right format as expected
{code:java}
[ { "record_id" : "DUMMY--1", "mode_completion" : "2", "Dateval" : "2024-12-04 
00:29:49" }, { "record_id" : "DUMMY--2", "mode_completion" : "2", "Dateval" : 
"2024-12-04 00:29:49" } ]{code}
I also tried to add the expression language to an attribute using 
UpdateAttribute processor and use the attribute in the JoinEnrichment  still 
the same issue it just prints the attribute name as it is.

I am also sharing the sample flow.json for testing.

  was:
Hey Team,

I am trying to use an Expression Language in the JoinEnrichment processor, to 
generate the date on the fly when running the SQL

SQL property on JoinEnrichment
{code:java}
SELECT original.*, '${now():format("yyyy-MM-dd HH:mm:ss", "Europe/Paris")}' AS 
Dateval FROM original WHERE record_id NOT IN (SELECT record_id FROM 
enrichment){code}
This gives me an output as follows without actually evaluating the expression 
language
{code:java}
[ { "record_id" : "DUMMY--2", "mode_completion" : "2", "Dateval" : 
"${now():format(\"yyyy-MM-dd HH:mm:ss\", \"Europe/Paris\")}" } ]{code}
When I run the same on QueryRecord processor
{code:java}
SELECT *, '${now():format("yyyy-MM-dd HH:mm:ss", "Europe/Paris")}' AS Dateval 
FROM FLOWFILE{code}
I get the expression language in the right format as expected
{code:java}
[ { "record_id" : "DUMMY--1", "mode_completion" : "2", "Dateval" : "2024-12-04 
00:29:49" }, { "record_id" : "DUMMY--2", "mode_completion" : "2", "Dateval" : 
"2024-12-04 00:29:49" } ]{code}
I also tried to add the expression language to an attribute using 
UpdateAttribute processor and use the attribute in the JoinEnrichment  still 
the same issue it just prints the attribute name as it is.I am also sharing the 
sample flow.json for testing.


> Expression Language doesn't evaluate in the JoinEnrichment processor
> --------------------------------------------------------------------
>
>                 Key: NIFI-14076
>                 URL: https://issues.apache.org/jira/browse/NIFI-14076
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.20.0
>         Environment: NiFi setup on Docker
>            Reporter: Joby Joje
>            Priority: Minor
>         Attachments: Dummy_Test.json
>
>
> Hey Team,
> I am trying to use an Expression Language in the JoinEnrichment processor, to 
> generate the date on the fly when running the SQL
> SQL property on JoinEnrichment
> {code:java}
> SELECT original.*, '${now():format("yyyy-MM-dd HH:mm:ss", "Europe/Paris")}' 
> AS Dateval FROM original WHERE record_id NOT IN (SELECT record_id FROM 
> enrichment){code}
> This gives me an output as follows without actually evaluating the expression 
> language
> {code:java}
> [ { "record_id" : "DUMMY--2", "mode_completion" : "2", "Dateval" : 
> "${now():format(\"yyyy-MM-dd HH:mm:ss\", \"Europe/Paris\")}" } ]{code}
> When I run the same on QueryRecord processor
> {code:java}
> SELECT *, '${now():format("yyyy-MM-dd HH:mm:ss", "Europe/Paris")}' AS Dateval 
> FROM FLOWFILE{code}
> I get the expression language in the right format as expected
> {code:java}
> [ { "record_id" : "DUMMY--1", "mode_completion" : "2", "Dateval" : 
> "2024-12-04 00:29:49" }, { "record_id" : "DUMMY--2", "mode_completion" : "2", 
> "Dateval" : "2024-12-04 00:29:49" } ]{code}
> I also tried to add the expression language to an attribute using 
> UpdateAttribute processor and use the attribute in the JoinEnrichment  still 
> the same issue it just prints the attribute name as it is.
> I am also sharing the sample flow.json for testing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to