简体   繁体   中英

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) `

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 :- 在此输入图像描述

Here cdr comes from GETSFTP and labels comes from get file processor and here cdr data will come continuously

can anyone help me to write above python code in ExecuteScript processor in nifi

The ExecuteScript processor cannot use native Python modules , only Jython code . Try using ExecuteStreamCommand to run arbitrary Python code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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