Eric,

You can use RecordPath with QueryRecord, via the RPATH, RPATH_STRING, 
RPATH_INT, etc. These are explained in the Processor's documentation. For 
example, see [1].

You can also use the Expression Language with QueryRecord. The Expression 
Language is evaluated before the SQL is parsed. So, for example, if you had an 
attribute named 'Field of Interest' you could actually use SQL like:

SELECT ${'Field of Interest'}
FROM FLOWFILE

Thanks
-Mark

[1] 
http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.2/org.apache.nifi.processors.standard.QueryRecord/index.html

On Oct 16, 2019, at 2:10 PM, Eric Chaves 
<e...@uolet.com<mailto:e...@uolet.com>> wrote:

Ok, figured out a way to do it. I noticed that QueryRecord uses Apache Calcite 
so I tried some of Calcite functions until I got into this statement that seems 
to work:

SELECT index FROM FLOWFILE WHERE CAST( SUBSTRING(index FROM 
CHAR_LENGTH(index)-9) AS DATE) <= CURRENT_DATE

Anyhow, I would still like to know if (and how) I could use either NiFi 
expression or RecordPath functions in a QueryRecord statement.

Thanks in advance,

Em qua, 16 de out de 2019 às 14:30, Eric Chaves 
<e...@uolet.com<mailto:e...@uolet.com>> escreveu:
Hi Folks,

I'd like to use a SQL statement in QueryRecords like this uses the extract the 
last 10 chars of  field and compare it to today, similar to the line below:

SELECT substring( '/index', 10, -1) as expired FROM FLOWFILE WHERE expired <= 
'${now():format("yyyy-MM-dd")}'

This statement is not work and I can't find a list of QueryRecord supported UDF 
or if (nd how) I can use RecordPath functions.

Is there any documentation where I can see the available UDFs?

Regards,


Reply via email to