Member since
05-30-2023
41
Posts
4
Kudos Received
0
Solutions
08-29-2023
08:39 AM
Can you help me with a similar issue? My code: import json import collections import java.io import ast from org.apache.commons.io import IOUtils from java.nio.charset import StandardCharsets from org.apache.nifi.processor.io import StreamCallback class ModJSON(StreamCallback) : def __init__(self): pass def process(self, inputStream, outputStream): text = IOUtils.toString(inputStream, StandardCharsets.UTF_8) obj = ast.literal_eval(text) mail = obj['mail'] outputStream.write(bytearray(json.dumps(obj['mail'], indent=4).encode('utf-8'))) outputStream.write(bytearray(json.dumps(obj['id'], indent=4).encode('utf-8'))) flowFile = session.get() if (flowFile != None): flowFile = session.write(flowFile, ModJSON()) flowFile = session.putAttribute(flowFile, "filename", flowFile.getAttribute('filename').split('.')[0]+'_translated.json') flowFile = session.putAttribute(flowFile, "mail", mail) session.transfer(flowFile, REL_SUCCESS) session.commit() I want to get "mail" value and create a new attribute for it. However, mail variable is not accessible when I insert it into the putattribute command. Any feedback?
... View more
08-29-2023
03:20 AM
I am executing python script in ExecuteStreamCommand and my code last line dumps the json key values. My goal is to read those key values into PutDatabaseRecord processor and insert the values in my database. However, I am unable to read content of the flow file of ExecuteStream. I have used ConvertAvrotoJson but it is showing output as "not a avro data file". Is there any workarounf of it? Thanks.
... View more
Labels:
- Labels:
-
Apache NiFi
-
NiFi Registry
08-28-2023
07:50 AM
Thanks for the reply. I did it in the same way you have mentioned (I am importing Selenium module and from this module, Service, WebDriverWait and EC components are imported) but late in the code execution, my scripts gives an error "global name Service is not defined". Any idea whats causing the issue?
... View more
08-28-2023
07:07 AM
@joseomjr I am trying to replicate your suggested method, please answer did you include the import command after sys.path.append command?
... View more
08-28-2023
06:29 AM
I want to run python script using ExecuteScript processor and my script has Selenium module to refer to as well. The Selenium module is written in Python language and I believe, it should run in the processor. Below are few lines of code depicting how I have added the modules: import sys sys.path.append(r"C:/Python311/Lib/site-packages/selenium/") sys.path.append(r"C:/Python311/Lib/site-packages/requests/") from org.apache.commons.io import IOUtils from java.nio.charset import StandardCharsets from org.apache.nifi.processor.io import StreamCallback Notice that after appending module in the path, I am not using "from module_name import.." command. However, in the code, the modules are not being fetched and it gives me error. Any help is appreciated.
... View more
Labels:
- Labels:
-
Apache NiFi
08-17-2023
04:49 AM
1 Kudo
Thanks. It was an issue with the connection string. It was pointing to another database while my processor was inserting into another database.
... View more
08-13-2023
07:20 AM
Should I be using "use statement" in my sql select query?
... View more
08-13-2023
03:48 AM
Hi, My task is to move data from my locally installed SQL server (16.0) to Azure SQL (12.0) hosted on my Azure subscription. So far, I have used ExecuteSQL processor to run my select query from SQL Server and it returns me the rows successfully. I have created a Database Polling Connection Service which connect to my SQL Server. After fetching the rows, I am using PutDatabaseRecord processor to insert the fetched rows into Azure SQL but its showing me error that "use statement is not supported to switch between databases". Note that the Database Polling Connection Service is different for PutDatabaseRecord where I have mentioned connection string of my Azure SQL. Please if anyone can give feedback on this issue and suggest any workaround.
... View more
Labels:
- Labels:
-
Apache NiFi
-
NiFi Registry
07-29-2023
11:30 AM
Awaiting response.
... View more
07-27-2023
11:09 AM
Hi, My Nifi Registry is hosted on a server and is configured using client certificates and I have my Nifi instance hosted locally on my machine also using client certificates. I am encountering this issues when I try to access buckets created in Nifi Registry from my Nifi instance: More details of Nifi client certificates: Owner: CN=localhost, OU=NIFI Issuer: CN=localhost, OU=NIFI More details of Nifi Registry client certificates: Owner: CN=<dns>, OU=NIFI Issuer: CN=localhost, OU=NIFI I read somewhere that the issuer of NiFi Registry cert, should be the owner of the trusted cert in NiFI's truststore and same is the case in my issue but even then, I cant access Nifi registry from my NIfi instance. Can anyone point out any technical issues or suggest where I am going wrong?Thanks
... View more
Labels:
- Labels:
-
Apache NiFi
-
NiFi Registry