简体   繁体   English

如何在apache nifi中的ExecuteScript处理器中编写pythoncode?

[英]How to write pythoncode in ExecuteScript processor in apache nifi?

Hi I have to execute below python code in apache nifi and my nifi flow is as below my python code is as below (I have ruined it locally it is working fine) ` 嗨我必须在apache nifi中执行下面的python代码,我的nifi流程如下我的python代码如下(我已经在本地毁了它工作正常)`

import pandas as pd
 cdr = pd.read_csv("cdr.csv")
 labels = pd.read_csv("result.csv")
 cdr.rename(mapper={str(value[0]):n for n,value in labels.to_dict(orient='list').items()},  axis=1, inplace=True)

and my nifi flow :- 和我的nifi流程: - 在此输入图像描述

Here cdr comes from GETSFTP and labels comes from get file processor and here cdr data will come continuously 这里cdr来自GETSFTP,标签来自get文件处理器,这里的cdr数据会不断出现

can anyone help me to write above python code in ExecuteScript processor in nifi 任何人都可以帮我在nifi中的ExecuteScript处理器上编写上面的python代码

The ExecuteScript processor cannot use native Python modules , only Jython code . ExecuteScript处理器不能使用本机Python模块 ,只能使用Jython代码 Try using ExecuteStreamCommand to run arbitrary Python code. 尝试使用ExecuteStreamCommand来运行任意Python代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM