Member since
07-27-2023
18
Posts
1
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2862 | 12-11-2023 10:43 AM |
02-14-2024
11:47 AM
I have a large json which needs to be chunked into 2 MB bites using split record. Output flowflies from split record are ordered based on frament.index. There is a replaceText step right after SplitRecord where the order of flowfiles doesn't match with the fragment.index. I want the flowfiles in the queue to be ordered by frament.index is there anyway we can achieve this?
... View more
Labels:
- Labels:
-
Apache NiFi
01-24-2024
10:46 AM
I have a COLB column on a table which contains Json. when I pull it using ExecuteSQLRecord, it is adding Escape Characters to the Json. How to avoid it adding escape Characters. [ { "COLB_COLUMN" : "{\"requestId\":\"502\",\"systemId\":\"77734175-3c8b-471d-b683-8bee62e7b975\",\"responseData\":[]}" } ] Updating Media I have also Tried using ExecuteSQL and convertAvroToJson still there are Escape Characters.
... View more
Labels:
- Labels:
-
Apache NiFi
01-18-2024
01:12 PM
I have a scenario where I need to set the status column in two tables to 'C' to mark the request as completed. Currently I am doing it using two PutSQL processors but I want to do that in a Transactinoal way to keep both tables consistent. UPDATE REQUEST SET STAT_CD = 'C', UPDT_DT= CURRENT_TIMESTAMP WHERE RQST_ID = '${requestId}'
... View more
Labels:
- Labels:
-
Apache NiFi
01-11-2024
05:45 AM
I have a API which I need to make a call to get the response using InvokeHttpProcessor. Incase if response status code is not 200's then I need to do a retry for 3 times ( incase of 400's and 500's). I see that I can set a retry on Failure, NO retry and Retry relationships but that is not working as expected. How to configure the relationships such that there I can achieve retry of 3 times on Failure, Retry and NoRetry relationships. Also is there a way to see how many retries are performed and is nifi logging this information some where?
... View more
Labels:
- Labels:
-
Apache NiFi
12-12-2023
06:45 AM
Hi @SAMSAL when I try in my local with the schema text that you provided. I am seeing this error: UpdateRecord[id=5e779eb4-018c-1000-b9ea-047535bdcfb5] Failed to write MapRecord[{SEARCH_RESULT=unescapeJson(/SEARCH_RESULT, 'true')}] with reader schema ["SEARCH_RESULT" : "STRING"] and writer schema {"type":"record","name":"nifi","namespace":"nifi.com","fields":[{"name":"SEARCH_RESULT","type":{"type":"record","name":"SEARCH_RESULT","fields":[{"name":"requestId","type":"string"},{"name":"responseData","type":{"type":"array","items":{"type":"record","name":"responseData","fields":[{"name":"searchKey","type":"string"},{"name":"data","type":{"type":"array","items":{"type":"record","name":"data","fields":[{"name":"firstName","type":"string"},{"name":"lastName","type":"string"}]}}}]}}}]}}]} as a JSON Object due to org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [unescapeJson(/SEARCH_RESULT, 'true')] of type class java.lang.String to Record for field SEARCH_RESULT org.apache.nifi.serialization.record.util.IllegalTypeConversionException: Cannot convert value [unescapeJson(/SEARCH_RESULT, 'true')] of type class java.lang.String to Record for field SEARCH_RESULT at Input that I am using is: [{ "SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }" }] also tried with { "SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }" } org.apache.nifi.serialization.record.util.DataTypeUtils.toRecord(DataTypeUtils.java:444)
... View more
12-11-2023
10:43 AM
one thing that worked for me use combination of EvaluateJsonPath -> UpdateAttribute -> ReplaceText I have added the entire json to attribute and in UpdateAttribute I have used "${searchValue:unescapeJson():replace('"{','{'):replace('"}','}')}" which does the trick and then used ReplaceText to replace the Entire Json content.
... View more
12-11-2023
10:01 AM
@joseomjr tried you suggestion, still seeing the same { "SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }" }
... View more
12-11-2023
09:10 AM
@joseomjr Thank you for you response. I have thought of execute script. but Nifi team in my company doesn't allow us to use ExecuteScript ( unless you are able to get desired solution with existing processors). Can you pls share how we can get it working using evaluateJsonPath? I have tried EvaluteJsonPath using $.[0].SEARCH_RESULT and Return Type as Json it is still picking up entire key value pair instead of value itself. Output of EvaluteJsonPath { "SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }" } Another question if you have array of objects how to convert each of them using EvaluteJsonPath?
... View more
12-11-2023
08:25 AM
@SAMSAL in the provided output it is a single record, the column that I am trying to pull is a CLOB on SQL and the query is pulling only one column and the output contains only one record.
... View more
12-11-2023
07:46 AM
Hi @SAMSAL yes I have tried it now, it is also returning the same [ { "SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }" } ]
... View more