apache-nifi

How can I get the Blob file using NiFi?

五迷三道 提交于 2020-06-26 14:40:07
问题 I have a table in Oracle DB with one column holding BLOB data. Does NiFi support Blob file from Oracle to PostgreSQL? if yes, what are the processors do I need to use for convert and store the data? I want to see the original content of the blob data in PostgreSQL. Thank you. 回答1: You can use ExecuteSQL to get the BLOB data out of Oracle, but currently you can't use ExecuteSQLRecord (due to this bug) or use PutDatabaseRecord to put BLOB data into a bytea field in PostgreSQL (due to this bug).

Jolt: concat Array values

我的梦境 提交于 2020-06-01 06:42:19
问题 Following my previous post Jolt: split/ concat array values in Nifi Now I'd like another value (ts) to be replicated into each split. My input: [ { "value0": 0, "value1": 1, "value2": 2, "ts": 1 }, { "value0": 3, "value1": 4, "value2": 5, "ts": 2 } ] Desired output: [ { "value0" : 0, "ts": 1 }, { "value1" : 1, "ts": 1 }, { "value2" : 2, "ts": 1 }, { "value0" : 3, "ts": 2 }, { "value1" : 4, "ts": 2 }, { "value2" : 5, "ts": 2 } ] The initial Jolt: [ { "operation": "shift", "spec": { "*": {

Jolt: concat Array values

久未见 提交于 2020-06-01 06:41:00
问题 Following my previous post Jolt: split/ concat array values in Nifi Now I'd like another value (ts) to be replicated into each split. My input: [ { "value0": 0, "value1": 1, "value2": 2, "ts": 1 }, { "value0": 3, "value1": 4, "value2": 5, "ts": 2 } ] Desired output: [ { "value0" : 0, "ts": 1 }, { "value1" : 1, "ts": 1 }, { "value2" : 2, "ts": 1 }, { "value0" : 3, "ts": 2 }, { "value1" : 4, "ts": 2 }, { "value2" : 5, "ts": 2 } ] The initial Jolt: [ { "operation": "shift", "spec": { "*": {

Apache Nifi 1.6: crash Groovy script

喜你入骨 提交于 2020-06-01 06:20:14
问题 In Apache Nifi parse xml in json. On local machine with limited data set my code work. In full data set, on server Apache Nifi, when JSON is collect, some values lead to errors. Full script: import groovy.json.* import org.apache.commons.io.IOUtils import java.nio.charset.StandardCharsets import org.apache.nifi.processor.io.StreamCallback def get_map(Node) { nodeRootName = Node.name() if (Node.childNodes().size() == 0) { return [(nodeRootName): (Node.text())] } else { subMap = [(nodeRootName)

Posting multiple files using invokehttp to API using nifi

陌路散爱 提交于 2020-05-30 13:21:56
问题 I am having 3 files which i need to post to API end. I am fetching 3 files using FetchHDFS process and i want to pass them to API. How can i pass them. Input: 3 files in HDFS Content-Type: multipart/form-data Error: invokehttp.response.body { "message": "Multipart: Boundary not found (user: 'undefined')", "level": "error", "timestamp": "2019-12-11T09:59:05.464Z" } Flow tried: inputPort --> 3 FetchHDFS process to fetch 3 different file --> invokeHttps curl commnad sample: curl -X POST "https:/

How to obtain first date of each month based on given year range in Nifi flow

青春壹個敷衍的年華 提交于 2020-05-17 07:18:06
问题 I would like to know what could be the best way to obtain the starting date values for each month based on the date range. For example: If I am given a year range of 2015-11-10 and 2018-01-15 (format YYYY-mm-dd). Then I would like to extract following dates: 2015-12-01 2016-01-01 . . 2018-01-01 回答1: You can try to use this flow for generating the first day of each month in the provided date range. Overall flow Step 1 Configuration: Start Step 2 Configuration: Configure Date Range Provide the

How to provide input to jolt when multiple objects are given

北慕城南 提交于 2020-05-17 07:04:13
问题 How to apply transformation to the json file having records in the following format (not array, just multiple objects). I want to provide a file with following input format and after applying transfornation.Want to get it saved in some folder. example: Input Record Format { "name": "adam", "age": 12, "city": "australia" } { "name": "adam", "age": 12, "city": "australia" } { "name": "adam", "age": 12, "city": "australia" } { "name": "adam", "age": 12, "city": "australia" } { "name": "adam",

Nifi multipart form

守給你的承諾、 提交于 2020-05-09 02:41:07
问题 I’m trying to do a very simple multipart form post to an api. I can’t see any way of doing this in apache Nifi since it only seems to have one input for form data. There seem to be a lot of existing questions about this on here and the Nifi forum but none of them have any answers. I’m trying to use invokehttp. Is there a way to build the multiple form data before I put it into invokehttp? 回答1: You could use ExecuteGroovyScript processor with the following code to build multipart/form-data:

How to run a python script with dependencies in a virtual environment in Nifi?

人走茶凉 提交于 2020-04-30 06:27:00
问题 Is there a way in Nifi to run a python script which has modules imported from a different folder, requirements specified in a pipfile and has arguments to pass? In short, how to execute a python script which usually runs in my virtual environment using Nifi? The end goal for me is to pick up a file using Get File and post it to API. I tried execute process, execute streamcommand processors. 回答1: To perform follow-on processing on the flowfile using Python, you can use the ExecuteStreamCommand

How to run a python script with dependencies in a virtual environment in Nifi?

这一生的挚爱 提交于 2020-04-30 06:26:34
问题 Is there a way in Nifi to run a python script which has modules imported from a different folder, requirements specified in a pipfile and has arguments to pass? In short, how to execute a python script which usually runs in my virtual environment using Nifi? The end goal for me is to pick up a file using Get File and post it to API. I tried execute process, execute streamcommand processors. 回答1: To perform follow-on processing on the flowfile using Python, you can use the ExecuteStreamCommand