Member since
07-29-2020
574
Posts
320
Kudos Received
175
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
269 | 12-20-2024 05:49 AM | |
315 | 12-19-2024 08:33 PM | |
315 | 12-19-2024 06:48 AM | |
264 | 12-17-2024 12:56 PM | |
257 | 12-16-2024 04:38 AM |
08-16-2023
08:59 AM
Can you elaborate more on what you are trying to split? The transactions in the first and second split you specified seem to be identical.
... View more
08-16-2023
06:30 AM
Hi, You can try the following spec: [
{
"operation": "shift",
"spec": {
"*": "&",
"responseData": {
"responseList": {
"*": {
"individualInfo": {
"#${UUID()}": "responseData.responseList.[&2].individualInfo.activityUID",
"firstName": "responseData.responseList.[&2].individualInfo.&",
"middleName": "responseData.responseList.[&2].individualInfo.&",
"lastName": "responseData.responseList.[&2].individualInfo.&",
"dateOfBirth": "responseData.responseList.[&2].individualInfo.&"
}
}
}
}
}
}
] If that helps please accept solution. Thanks
... View more
08-02-2023
09:35 AM
1 Kudo
Hi @Anderosn , The ConvertJsonToSQL according to the documentation will map fields only with simple type: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache.nifi.processors.standard.ConvertJSONToSQL/index.html "...The incoming FlowFile is expected to be "flat" JSON message, meaning that it consists of a single JSON element and each field maps to a simple type..." If you dont care about storing array fields as is, then you can use JoltTransformJson to convert array fields to concatenated string. The jolt spec to do this can be as the following: [
{
"operation": "modify-overwrite-beta",
"spec": {
"CARDNUMBER": "=join(',',@(1,CARDNUMBER))",
"EXPIRYDATE": "=join(',',@(1,EXPIRYDATE))",
"EMAIL": "=join(',',@(1,EMAIL))"
}
}
] This will produce the following output: {
"REQUESTID" : "379",
"REQUESTTYPE" : "V",
"REQUESTCONTEXT" : "B2B",
"CARDNUMBER" : "5537290000000511,5537290000000522",
"EXPIRYDATE" : "08/20,09/21",
"EMAIL" : "John.Jones123@abcmail.com,Jason.456@gmail.com",
"PHONENUMBER" : "11234565555"
} Which can be converted to SQL using the ConvertJsonToSQL and all fields will be populated. Hope that works. If that helps please accept solution. Thanks
... View more
08-01-2023
06:54 AM
1 Kudo
Hi @MWM , What you are describing is a classical data enrichment pattern that can be achieved using ForkEnrichment & JoinEnrichment processors. For more information on this please refer to : https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.JoinEnrichment/additionalDetails.html Based on your scenario the "SQL" strategy of the JoinEnrichment will work the best for you since you can select the main fields (system, name, surname, phone, mail) from the original flowfile data and select proffesion and department from enrichment result: SELECT o.system, o.name, e.surname,o.phone, o.mail, e.profession, e.department FROM original o LEFT OUTER JOIN enrichment e ON o.name= e.name Since you are splitting the CSV and enrich per record then you can just join by name. If you have an API where you can get a collection of user information then you dont have to split and you can do the enrichment on multiple records from the CSV vs. returned records from the API json output , however be aware that if you have large data set this strategy "... can lead to heap exhaustion and cause stability problems or OutOfMemoryErrors to occur". Please review the link above to see how this can be mitigated. If you find this is helpful please accept solution. Thanks
... View more
07-31-2023
01:42 PM
Hi @nict , Not sure how you want to add your headings (firstDetails, secondDetails...etc.) specially secondDetails is not found anywhere in your jolt spec. If you are just looking to associate different records (test1, test2, test3...etc.) to different header based on the value of "Name" where you have to list each Name value explicitly, then something like this will work: [
{
"operation": "shift",
"spec": {
"dataPackage": {
"datatest": {
"field": {
"*": {
"Name": {
"test1": {
"@(2,content)": "firstDetails.test1"
},
"test2": {
"@(2,content)": "firstDetails.test2"
},
"test3": {
"@(2,content)": "secondDetails.test3"
}
}
}
}
}
}
}
}
] You can add more values\header as needed. However, if you are looking to create header dynamically based on the Name values then you have to provide more info on how you would associate records with header. If that helps please accept solution. Thanks
... View more
07-31-2023
07:09 AM
Hi @MihaiMaranduca , You can use the "Run Schedule" Property to control how often a given processor runs. You can access this property by opening process Configuration, then select the Scheduling tab: The Run Schedule can be configured using the Scheduling Strategy: 1- Timer Driven (Default): Run processor based on interval. the Zero value indicates that its running continuously. 5 secs mean every 5 seconds, 5 mins mean every 5 minutes and so on. 2- CRON Driven: Processor runs based on a schedule specified by CRON string. More info on Scheduling: https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#scheduling-tab If you find this is helpful please accept solution. Thanks
... View more
07-28-2023
05:28 AM
1 Kudo
Hi @Anderosn, Similar question was asked before, see if the following posts can help: https://community.cloudera.com/t5/Support-Questions/How-to-load-json-record-to-postgres-as-json-datatype/m-p/345779#M234644 https://community.cloudera.com/t5/Support-Questions/Apache-Nifi-Insert-json-data-into-table-as-single-column/m-p/363974 https://community.cloudera.com/t5/Support-Questions/nifi-Writing-Inserting-entire-flowfile-content/td-p/205367 If Any of the links work for your case please accept solution. Thanks
... View more
07-26-2023
05:39 AM
1 Kudo
Hi @mandychen , Have you tried removing the double quotes from "ACPMA" in the Table Name property of the PutDatabaseRecord? I dont think you need it there. If that helps please accept solution. Thanks
... View more
07-25-2023
11:14 AM
Hi @brajeshreddy , I dont think you can achieve this using the ControlRate processor. Instead I recommend the solution mentioned here: https://stackoverflow.com/questions/69893107/nifi-activate-a-flow-file-after-a-previous-flow-file-goes-through-the-downstre If you have a cluster then make sure that the top processor is executing on the Primary node. hope that helps. Thanks
... View more
07-25-2023
06:30 AM
1 Kudo
Hi @Diga , Here are some videos to help you get started with the InvokeHttp Processor: https://www.youtube.com/watch?v=aNrdWYy4i34 https://www.youtube.com/watch?v=SZhX_gce63E https://www.youtube.com/watch?v=Jk7H8w3evN0 As far as logging in and authentication, it depends what kind of authentication the Rest API has. If it has simple authentication (username & password) you can enter those in the Basic Authentication Username & Basic Authentication Password properties. If you need to get Access Token (OAuth2) then you either obtain this through another InvokeHttp processor and pass it to the actual rest api invokehttp as "Authorization" header property (dynamically added to the processor), or second option is to take advantage of the "OAuth2 Access Token provider" in the InvokeHttp processor by setting up "StandardOauth2AccessTokenProvider" service and provide the credentials and the access token url there. Hope that helps. Thanks
... View more