Support Questions

Find answers, ask questions, and share your expertise

NiFi: Passind date from command line

avatar
Explorer

Hi Gurus,

I need to run a Hive QL which takes date as condition. I want to pass this date by caling the NiFi job through cron/shell. Could you let me know how can I achive this in NiFi please.

Any sample flow would really helps.

Thanks,
Kumar

2 REPLIES 2

avatar
Expert Contributor

@kumar79  I am not very sure with your complete use case, if you explain more would be better.

Why you want to take date from shell/cron? you can use UpdateAttribute processor with custom property and use NiFi Regular Expression language to set date for you. E.g https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#dates

The attribute later you can use in your flow to satisfy QL condition.

 

Hope it helps.

-Akash

avatar
Explorer

Hi Akash,

 

Sorry for the delay and thanks for the response. I want to avoid updating the flow incase if we have to run the flow for any old dates. 

 

If any such request comes I just want to run the flow through shell by just passing old date.

 

Hope the requirement is clear to you.

Thanks,