Member since
05-30-2023
34
Posts
2
Kudos Received
0
Solutions
10-19-2023
04:50 AM
I resolved the issue. I had DepartmentId in my avro schema however, I was getting DepartmentID in the input. Schemas are case sensitive. Now, that the string values are appended in the DepartmentID column, I am using RouteOnContent processors and using ${DepartmentID:equals('Undefined')} to match if the DepartmentID' values are of undefined or null type. It is not identifying the "Undefined" values. is the regex statement correct? Content of flow file is: [ { "TenantId" : "FF369226-0EDA-4D0D-B48C-6B27F404ECCB", "DepartmentID" : "Undefined", "Name": "xyz" } ]
... View more
10-19-2023
03:55 AM
I am reading avro flow flow (using embedded schema) and for writing it, I am providing schema.text. My schema text is this: { "name": "nifi", "type": "record", "fields": [ { "name": "TenantId", "type": ["null","string"] }, { "name": "DepartmentId", "type": ["null","string"] }, { "name": "Name", "type": ["null","string"] } ] } The issue is its not retaining DepartmentID as strings and converting them to null.
... View more
10-19-2023
01:18 AM
Hi all. I have two avro-binary types of flow files and their content is: Flow file one: [ { "DepartmentID" : "Undefined", "Name" : "Non Billable", } ] Flow file two:[ { "DepartmentID" : "Null", "Name" : "Tax", } ] I am using UpdateRecord processor to add a key:value (tenantId) in the same file for which I am using below avro schema: { "name": "nifi", "type": "record", "fields": [ { "name": "TenantId", "type": ["null","string"] }, { "name": "DepartmentId", "type": ["null","string"] }, { "name": "Name", "type": ["null","string"] } ] } I am using literal value replacement value strategy and getting TenantId from previous processors. So far, this is a success and tenantId is appended. However, as a result, the DepartmentId changes to null for BOTH the files. Where I can ensure that the DepartmentId's values are not changed because based on these values, I have to route the "undefined" file for further processing. Any help would be appreciated. Thanks.
... View more
Labels:
- Labels:
-
Apache NiFi
10-02-2023
10:12 AM
Thats right. I intend to convert the json using JoltTransfomationRecord into csv format and then save the file in my local machine.
... View more
10-02-2023
09:40 AM
@SAMSAL thank you for responding. I am infact using/converting the output from ExecuteSql from Arvo to Json using ConvertAvroToJson processor. Below is the output of the same processor: I am also wondering if I am providing the json format, its throwing error for avro. Can you suggest something?
... View more
10-02-2023
09:19 AM
@araujo I am trying to implement your suggested way. My json is : { "Id" : "some int", "TenantId" : "some double value" } and I am using chain jolt transform method as: [ { "operation": "shift", "spec": { "*": { "@(1,Id)": "[&1].Id", "@(1,TenantId)": "[&1].TenantId" } } }] However, I am getting a error as: Can you tell where I am going wrong? Thanks.
... View more
09-22-2023
01:36 AM
Any feedback will be appreciated. Thanks.
... View more
09-21-2023
12:48 PM
Hi, I have a python code which is trying to authenticates to my NIFI server and start a processor inside it. Please see code below: from flask import Flask import nipyapi import requests app = Flask(__name__) @app.route('/') def home(): nifi_url = "https://mynifiinstance:port/nifi-api/access" processor_id = <processorID> nifi_general = "https://mynifiinstance/nifi-api" start_processor_url = f"{nifi_general}/processors/{processor_id}/run-status" headers = {'Content-Type': 'application/x-www-form-urlencoded'} username = "username" password = "password" data = { "username": username, "password": password } response = requests.post(url=nifi_url, data=data,verify=False, headers=headers) if response.status_code == 200: # if successfully authenticated, then start the processor start_processor = requests.put(url=start_processor_url, headers=headers) print(start_processor.status_code) if start_processor.status_code == 200: return("Processor started successfully.") else: return(f"Starting processor failed. Status code: {start_processor.status_code}") else: return(f"Failed to start processor. Status code: {response.status_code}") if __name__ == '__main__': app.run() However, I am unable to authenticate with the given username and password. Note: that I have not made any changes in the nifi.properties file. Does it have to be changed? Looking fwd to your responses.
... View more
Labels:
- Labels:
-
Apache NiFi
-
NiFi Registry
09-01-2023
01:44 AM
I am trying to make a conenction to my Sql Server using "zxJDBC". Below is my code in ExecuteScript processor: from com.ziclix.python.sql import zxJDBC d, u, p, v = "jdbc:sqlserver://<servername>;Database=<databasename>;encrypt=true;trustServerCertificate=true;user=<username>;password=<password>;integratedSecurity=true", None, None, " com.microsoft.sqlserver.jdbc.SQLServerDriver" db = zxJDBC.connect(d, u, p, v) c = db.cursor() However, I am getting an error " zxjdbc.database error driver com.microsoft.sqlserver.jdbc.SQLServerDriver not found" My limted research in internet found out that it is dependent on some jar files how how can we add jar files classpath in nifi processors. Please guide in making this Sql server connection successful. Thanks.
... View more
Labels:
- Labels:
-
Apache NiFi
-
NiFi Registry