Member since
07-08-2022
51
Posts
8
Kudos Received
2
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 984 | 07-30-2025 12:06 PM | |
| 2604 | 12-17-2022 10:54 PM |
11-26-2024
10:37 AM
1 Kudo
HI All, Im getting below error after new fileds are being added to the payload from Kafka OpenTX, datatype: double precision charges, Datatype: string note:before these 2 fields added to the payload its working fine with existing json reader and writer Error: 05:25:40 UTCERRORConsumeKafkaRecord_2_6[id=8f8pq352c-0rcb] Failed to parse message from Kafka using the configured Record Reader. Will route message as its own FlowFile to the 'parse.failure' relationship: org.apache.nifi.serialization.MalformedRecordException: Successfully parsed a JSON object from input but failed to convert into a Record object with the given schema - Caused by: org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [[Ljava.lang.Object;@6b9b8a0c] of type class [Ljava.lang.Object; for field invoiceLineList.ecoTaxValues to any of the following available Sub-Types for a Choice: [ARRAY[STRING], ARRAY[DOUBLE]] input payload: { "Identifier":"123456", "creationDate":"2024-11-22T12:22:01.331894Z", "docType":"01", "currency":"INR", "taxCode": [null,null,null,"04",null,null,null,null,null], "invoiceLineList": [ { "line":1, "charges":["009",null,null], "OpenTX": [0.3,0.9,null,null] }, { "line":2, "charges":["002",null,null], "OpenTX": [0.1,1.9,null,null] } ] } below are the json reader and writer configs. JSONTreeReader: JSONrecordSETWriter i've tried changing reader to AVRO reader using "Confluent Content-Encoded Schema Reference" in the Avro Reader "Schema Access Strategy" field and keeping JsonRecordsetwriter same as above but still its not working, Can anyone help me here? @SAMSAL thanks!!
... View more
Labels:
- Labels:
-
Apache NiFi
08-05-2024
10:53 AM
@SAMSAL , Thanks for the reply but our current nifi version is 1.23.2 , where it doesn't have that completion strategy. So thinking of implementing executeScript or executeStreamcommand in order to delete the files from SMB after fetchSMB. Please let me know if you have any suggestions for this script , nifi hosted on kube clusters and i've credentials for SMB as well.
... View more
07-26-2024
07:36 PM
1 Kudo
Thanks @SAMSAL for giving solution, I'm using listsmb and Fetchsmb , with the similar approch. How can we ensure to delete those files after fetch, as we are not using no tracking files will come recursively . 2)can i use list file & fetchfile to connect smb share (\\server\share$\path\) thanks!!
... View more
07-10-2024
11:39 AM
HI Team, we have jar executable which is running fine in Nifi 1.15 version after we upgraded to 1.17 , when we tried to execute that jar its showing as invalid or corrupt jar file. when we checked java version both nifi and jar executable are on same version i.e. java 8 however we noticed that jdk versions are different from previous version to latest version nifi 1.15 having openjdk version 1.8.0_312 Nifi 1.17 having openjdk version jdk1.8.0_332 suspecting this caused issue, however we are not able to update the jar. Can anyone help here what might be the issue here and how we can solve this issue. thanks
... View more
Labels:
- Labels:
-
Apache NiFi
07-10-2024
11:23 AM
Hi All, How to fetch all files in a directory based on one specific file arrive in that directory Ex: when i've file with extension .trg is there i've to fetch all files (irrespective of name and extension of these files) in that directory list there are .txt, .xml and . xlsx files are there in \\server\share\test\ all these files should be fetched whenever there is file with extension .trg arrive I've tried this scenario using ListSMB-->wait/notify--> Fetchsmb but didn't working are there any solutions suggested by anyone?
... View more
Labels:
- Labels:
-
Apache NiFi
03-13-2024
11:54 AM
2 Kudos
@SAMSAL , After i added escaping to $ with double slash it got worked in shift too. "#\\${netval}": "&3[&2].&1" thanks a lot again
... View more
03-12-2024
10:32 AM
Thanks a Lot the JOLT Master @SAMSAL , Modify-overwrite beta -logic worked perfectly. but for Shift logic jolt demo throwing an execption Invalid reference key=#${netval} either blank or doesn't start with correct character=$
... View more
03-11-2024
12:57 PM
Hi All, I would like to replace first element of an array value i.e would like to replace with first net val with nifi attribute input { "iH": [ { "DN": "711449", "iLineList": [ { "DNnumber": "711449", "DNLineNumber": 2 }, { "DNNumber": "711449", "DNLineNumber": 3 } ], "netval": "22.09" }, { "DN": "711450", "iLineList": [ { "DNnumber": "711450", "DNLineNumber": 2 }, { "DNNumber": "711450", "DNLineNumber": 3 } ], "netval": "11.09" } ] } defined SPEC like : [ { "operation": "shift", "spec": { "*": { "0": { "netVal": "iH[&1].netVal[0]", "*": "iH[&1].&" }, "*": "&1" } } }, { "operation": "modify-overwrite-beta", "spec": { "*": { // "invoiceHeader": { "0": { "netVal": "${netVal}" } // } } } } ] Expected output: { "iH" : [ { "DN" : "711449", "iLineList" : [ { "DNnumber" : "711449", "DNLineNumber" : 2 }, { "DNNumber" : "711449", "DNLineNumber" : 3 } ], "netval" : "${netval}" }, { "DN" : "711450", "iLineList" : [ { "DNnumber" : "711450", "DNLineNumber" : 2 }, { "DNNumber" : "711450", "DNLineNumber" : 3 } ], "netval" : "11.09" } ] }
... View more
Labels:
- Labels:
-
Apache NiFi
11-09-2023
09:55 AM
@SAMSAL , thanks for the quick response. As always you do.
... View more
11-08-2023
10:33 AM
Hi @SAMSAL Please find my input and spec below. my input currently consists natura value other than 3.5 i.e 3.1. Sometimes input won't contain natura value at all. So thats why my spec will a little different than yours. in this case i don't want AltriDatiGestionali tag , but since i'm using modify-overwrite-beta logic its getting as empty, how to get rid of this. INPUT: { "FatturaElettronicaBody": { "DatiBeniServizi": { "DettaglioLinee": [ { "Natura": "3.1", "NumeroLinea": 1, "Descrizione": "A2751500680 BOBINA DI ACCENSIONE", "PrezzoTotale": "3718.26000000" } ] } } } SPEC: [ { "operation": "shift", "spec": { "FatturaElettronicaBody": { "DatiBeniServizi": { "DettaglioLinee": { "*": { "AltriDatiGestionali": "FatturaElettronicaBody.DatiBeniServizi.AltriDatiGestionali", "*": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&1].&" } } } } } }, { "operation": "shift", "spec": { "FatturaElettronicaBody": { "DatiBeniServizi": { "DettaglioLinee": { "*": { "NumeroLinea": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&1].NumeroLinea", "PrezzoTotale": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&1].PrezzoTotale", "Descrizione": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&1].Descrizione", "Natura": { "N3.5": { "$": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].Natura", "@(2,NumeroLinea)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].NumeroLinea", "@(2,PrezzoTotale)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].PrezzoTotale", "@(2,Descrizione)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].Descrizione", "@(4,AltriDatiGestionali)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].AltriDatiGestionali" }, "*": { "$": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].Natura", "@(2,NumeroLinea)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].NumeroLinea", "@(2,PrezzoTotale)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].PrezzoTotale", "@(2,Descrizione)": "FatturaElettronicaBody.DatiBeniServizi.DettaglioLinee[&3].Descrizione" } } } } } } } }, { "operation": "modify-overwrite-beta", "spec": { "FatturaElettronicaBody": { "DatiBeniServizi": { "DettaglioLinee": { "*": { "AltriDatiGestionali": { "splitRiferimentoTesto": "=split('-',@(1,RiferimentoTesto))", "stringsize": "=size(@(1,splitRiferimentoTesto[0]))", "RiferimentoTesto": "=substring(@(1,splitRiferimentoTesto[0]),26,@(1,stringsize))", "stringsize1": "=size(@(1,splitRiferimentoTesto[1]))", "RiferimentoD": "=substring(@(1,splitRiferimentoTesto[1]),11,@(1,stringsize1))", "splitRiferimentoData": "=split('/',@(1,RiferimentoD))", "RiferimentoData": "=concat(@(1,splitRiferimentoData[2]),'-',@(1,splitRiferimentoData[1]),'-',@(1,splitRiferimentoData[0]))" } } } } } } }, { "operation": "remove", "spec": { "FatturaElettronicaBody": { "DatiBeniServizi": { "DettaglioLinee": { "*": { "AltriDatiGestionali": { "splitRiferimentoTesto": "", "splitRiferimentoData": "", "stringsize": "", "stringsize1": "", "RiferimentoD": "" } } } } } } }, { "operation": "cardinality", "spec": { "FatturaElettronicaBody": { "DatiBeniServizi": { "DettaglioLinee": { "*": { "NumeroLinea": "ONE", "Descrizione": "ONE", "Quantita": "ONE", "PrezzoUnitario": "ONE", "ScontoMaggiorazione": "ONE", "AltriDatiGestionali": "ONE", "PrezzoTotale": "ONE", "AliquotaIVA": "ONE" } } } } } }, { "operation": "modify-overwrite-beta", "spec": { "*": "=recursivelySquashNulls" } } ]
... View more