Koustav,

I took your script (with GenerateFlowFile before it) and ran just fine
(meaning the file is created and the processor does not hang). When I
didn't have write permissions for the target folder, I got an
error/bulletin telling me this. When I did have write permissions, it works
fine.

However I should mention that if you want something to go to the PutFile
(in your flow above), you will not get anything output (to the flow) with
your current script. Instead you need to create/reuse a flow file and then
use the session to transfer it. There is an example of how to do this on my
blog:
http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited_14.html

Regards,
Matt

On Wed, Aug 17, 2016 at 7:34 PM, koustav choudhuri <koustav1...@gmail.com>
wrote:

> Matt
>
> Thanks for Replying , but I am still struggling with ExecuteScript.
>
>
> [image: Inline image 1]
>
>
> in that ExecuteScript all I have is :
>
> Script - set to Python
> Script Body :
> from sys import argv
>
> filename = "nifi_output/nifi_test.txt"
> target = open(filename, 'w')
> target.write("My Name is Bond")
> target.close()
>
> When I run this , Nifi hangs for some reason. Am I doing something grossly
> wrong ?
>
>
>
>
>
>
> On Wed, Aug 17, 2016 at 3:57 PM, Matt Burgess <mattyb...@gmail.com> wrote:
>
>> If you need an input flowfile, you're probably better off with
>> ExecuteStreamCommand than ExecuteScript for this use case.
>> ExecuteStreamCommand is much like ExecuteProcess but it accepts input flow
>> files.
>>
>> Regards,
>> Matt
>>
>> > On Aug 17, 2016, at 6:49 PM, koustav choudhuri <koustav1...@gmail.com>
>> wrote:
>> >
>> > HI All
>> >
>> > I am trying to execute 2 different shell scripts ( calling a sqoop job
>> and calling a hive script) in a sequence. Can I achieve this through NIFI ?
>> >
>> > I tried to do it through ExecuteProcess Processor but the issue is
>> Execute Processor does not accept an input.
>> >
>> > Then I moved to ExecuteScript :
>> > Created 2 different python scripts, 1 calling the Sqoop job and the
>> other calling the Hive script and arranged them in 2 different
>> ExecuteScript Processors but looks like it doesnt work.
>> >
>> > Can you guys tell me if this is achievable in NIFI? Can I call
>> Sqoop/HIVE/ SPARK jobs residing on other servers in a sequence or flow with
>> NIFI?
>> >
>> >
>> > Thanks
>> > Koustav
>>
>
>

Reply via email to