Support Questions

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

How to give dynamic query in queryrecord processor in Nifi ?

avatar

Hi,

I want to do something like this

SELECT * FROM FLOWFILE WHERE Gender = '${gender}'

Need Help. Thanks

1 ACCEPTED SOLUTION

avatar
Master Guru

You should be able to do exactly what you showed with ${gender} as long as your incoming flow files have an attribute called gender. You would have to create that attribute before QueryRecord by using UpdateAttribute or by using a processor that extracts something from the content of the flow into an attribute called gender.

View solution in original post

3 REPLIES 3

avatar

If I do -> SELECT * FROM FLOWFILE WHERE Gender = 'Male', It works

avatar
Master Guru

You should be able to do exactly what you showed with ${gender} as long as your incoming flow files have an attribute called gender. You would have to create that attribute before QueryRecord by using UpdateAttribute or by using a processor that extracts something from the content of the flow into an attribute called gender.

avatar

Thnks Bryan