Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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