Created 10-09-2018 07:41 AM
Hi all,
I am using Python ExecuteScript in Apache NiFi to list all Databases name in Mongo then load all tables name in Mongo, however, they dont have lib mongo. Do you know How to import python libs for ExecuteScript?
Or any suggestions to load all Databases name and tables name in Mongo in Nifi
Many thanks
Created 10-09-2018 02:14 PM
-
Does your Python script execute fine via command line on your NiFi servers?
If so, did you consider instead just using the ExecuteStreamCommand processor to execute your script? This will behave in same way as executing yourself form command line and will not rely on NiFi built in libs.
-
The latest version of NiFi contain numerous mongo specific processors. I am not a Mongo user myself, but have you looked to see if any of those would meet the needs of your dataflow here?
-
Thank you,
Matt
-
If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.
Created 10-12-2018 03:41 AM
If the "mongo" library contains native Python (CPython) code or dependencies, you can't use them in ExecuteScript (which uses Jython not Python). See Matt C's answer for a workaround to use actual Python.
Created 10-20-2018 04:39 PM
Hi Matt, thanks for your answers, do you think Mongo is native in Groovy or JavaScript?
Thanks
Created 10-22-2018 02:53 PM
There is a mongo-java-driver you can use in either Groovy or Javascript (or any of the scripted languages in ExecuteScript), check my blog on how to use modules.