Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

[Nifi] filter on date using queryRecord processor

avatar
New Contributor

Hello everyone, 

 

I'm new with Apache Nifi, i'm trying to filter on a date column with the format yyyy-mm-dd using the queryRecord processor. Data come from CSV file. What i want to do is to filter and keep all records that have the column date greater or equal than the current date, i tried: 

 

select * from flowfile where date >= currentDate();

 

But that does not work

 

if it is not possible with the queryRecord processor, which one can achieve that ?

 

Does anyone have an idea ?

 

Thanks in advance 

1 REPLY 1

avatar
New Contributor

You will need to use the Calcite current_date equivalent, like so:

 

SELECT * FROM flowfile WHERE date >= {fn CURDATE()}

 

Hope this helps!

 

See here for more Calcite definitions:  https://calcite.apache.org/docs/reference.html