0

I am using Apache Nifi and there the executeScript processor for python. I understand from other entries that this processor runs on Jython, which can not import libraries using CPython like e.g. numpy. The library I want to use uses pandas and numpy. I found JyNI library and tried to get it running in the executeScript processor. But was not successful. When adding the libraries to the nifi classpath I get an exception that jython can not be loaded. I also found that Jython.jar is in the processor nar file.

Any suggestions whether JyNI has any chance of success in this case? Any idea on how to get JyNI properly setup for this processor?

UPDATE: Nifi version 1.8, ExecuteScript Processor 1.8.0, Java version 1.8, JyNI version 2.7 alpha-5

  • please edit your question and provide more information: nifi version, JyNI version and where you try to put it, what error do you have (check also the log files) – daggett Jan 11 '19 at 14:23

1 Answers1

0

You can write a simple Python wrapper for the logic you want to execute, and use ExecuteStreamCommand to run python my_script.py <args...>, which will invoke the wrapper script on the command-line, and use native Python. This answer has more details about how the ESC processor passes the flowfile content to/from the script via STDIN and STDOUT and example configurations.

Andy
  • 13,916
  • 1
  • 36
  • 78