[
https://issues.apache.org/jira/browse/NIFI-5094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16445515#comment-16445515
]
Sivaprasanna Sethuraman commented on NIFI-5094:
-----------------------------------------------
I'm afraid I'm not able to reproduce in NiFi 1.3.0 on my end. The following
works fine:
{code:java}
${'Custom Extract Query':toLower():contains('select')}
${'Custom Extract Query':toLower():isEmpty()}{code}
BTW, although the following are correct, syntax-wise, they won't work i.e. it
will not read the value of 'Custom Extract Query' so you have to use the above
approach:
{code:java}
${${'Custom Extract Query'}:toLower():contains('select')}
${${'Custom Extract Query'}:toLower():isEmpty()}{code}
Also note that you're missing `()` in `toLower` in the examples provided.
> EL Operations doesn't work for attributes having names with spaces
> ------------------------------------------------------------------
>
> Key: NIFI-5094
> URL: https://issues.apache.org/jira/browse/NIFI-5094
> Project: Apache NiFi
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 1.3.0
> Environment: OS: RHEL 7.2
> Apache NiFi: 1.3.0
> Reporter: Adil
> Priority: Minor
>
> If we declare an attribute having space in between the name, the EL
> operations doesn't work the way they should work.
> Example:
> Attribute Name declared(without quotes): 'Custom Extract Query' (value is a
> SQL query like:
> {code:java}
> select colA,colB,colC from dbName.tableName'{code}
> )
> EL Operations tested:
> {code:java}
> ${${'Custom Extract Query'}:toLower:contains('select')}
> ${${'Custom Extract Query'}:toLower:isEmpty()}{code}
> If I remove the spaces from the attribute name, the above EL operations work
> properly.
> Adding more explanation:
> I tried multiple possible ways for this to work before mentioning it out as
> bug.
> Not working snippets:
> {code:java}
> ${${'Custom Extract Query'}:toLower:contains('select')}
> ${${'Custom Extract Query'}:toLower:isEmpty()}
> ${'Custom Extract Query':toLower:contains('select')}
> {${'Custom Extract Query':toLower:isEmpty()}
> {code}
>
> Working Code:
> {code:java}
> ${${'CustomExtractQuery'}:toLower:contains('select')}
> ${${'CustomExtractQuery'}:toLower:isEmpty()}
> ${CustomExtractQuery:toLower:contains('select')}
> ${CustomExtractQuery:toLower:isEmpty()}
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)