You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by agathis <ag...@agathis.org> on 2020/11/18 07:43:18 UTC
SQL case-like in UpdateRecord of QueryRecord
Hi everyone!
After an upgrade from 1.1 to 1.9 I'm exploring the new record-based NiFi
paradigm.
What I need now is (in SQL) something like select case when column =
'value' then 'some text' end new_column from flowfile
It doesn't work as expected in QueryRecord (and it gets even worse if I use
non-latin symbols in the query).
And I didn't find anything to this effect in UpdateRecord syntax.
Is it possible to implement without reading record attributes to ff
attributes?
Re: SQL case-like in UpdateRecord of QueryRecord
Posted by Mark Payne <ma...@hotmail.com>.
Hello,
I’m not sure that I fully understand what you’re trying to do.
I *think* what you’re saying is that you want to something like:
If (a == “hello”) then set b to “good-bye”
Is that correct?
If so, then that is done in UpdateRecord by adding a property with name:
/b[/a = ‘hello’]
And value:
good-bye
So this would say set the value of field found at /b to “good-bye” but only if the predicate (/a = ‘hello’) is true.
Thanks
-Mark
________________________________
From: agathis <ag...@agathis.org>
Sent: Wednesday, November 18, 2020 1:43 AM
To: users@nifi.apache.org <us...@nifi.apache.org>
Subject: SQL case-like in UpdateRecord of QueryRecord
Hi everyone!
After an upgrade from 1.1 to 1.9 I'm exploring the new record-based NiFi paradigm.
What I need now is (in SQL) something like select case when column = 'value' then 'some text' end new_column from flowfile
It doesn't work as expected in QueryRecord (and it gets even worse if I use non-latin symbols in the query).
And I didn't find anything to this effect in UpdateRecord syntax.
Is it possible to implement without reading record attributes to ff attributes?