<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Avro to Json adding extra delemeters in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380661#M244121</link>
    <description>&lt;P&gt;I think you could probably use EvaluateJsonPath to parse the JSON value for "SEARCH_RESULT" but I like scripted processors so I would use a Groovy based InvokeScriptedProcessor with this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import java.nio.charset.StandardCharsets

class GroovyProcessor implements Processor {
    PropertyDescriptor BATCH_SIZE = new PropertyDescriptor.Builder()
        .name("BATCH_SIZE")
        .displayName("Batch Size")
        .description("The number of incoming FlowFiles to process in a single execution of this processor.")
        .required(true)
        .defaultValue("100")
        .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
        .build()

    Relationship REL_SUCCESS = new Relationship.Builder()
        .name("success")
        .description('FlowFiles that were successfully processed are routed here')
        .build()

    Relationship REL_FAILURE = new Relationship.Builder()
        .name("failure")
        .description('FlowFiles that were not successfully processed are routed here')
        .build()

    ComponentLog log
    JsonSlurper jsonSlurper = new JsonSlurper()
    JsonOutput jsonOutput = new JsonOutput()

    void initialize(ProcessorInitializationContext context) {
        log = context.logger
    }

    Set&amp;lt;Relationship&amp;gt; getRelationships() {
        Set&amp;lt;Relationship&amp;gt; relationships = new HashSet&amp;lt;&amp;gt;()
        relationships.add(REL_FAILURE)
        relationships.add(REL_SUCCESS)
        return relationships
    }

    Collection&amp;lt;ValidationResult&amp;gt; validate(ValidationContext context) {
        
    }
    
    PropertyDescriptor getPropertyDescriptor(String name) {
        
    }
    
    void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) {

    }
    
    List&amp;lt;PropertyDescriptor&amp;gt; getPropertyDescriptors() {
        List&amp;lt;PropertyDescriptor&amp;gt; descriptors = new ArrayList&amp;lt;&amp;gt;()
        descriptors.add(BATCH_SIZE)
        return Collections.unmodifiableList(descriptors)
    }
    
    String getIdentifier() {
        
    }

    void onScheduled(ProcessContext context) throws ProcessException {
        
    }

    void onUnscheduled(ProcessContext context) throws ProcessException {
        
    }

    void onStopped(ProcessContext context) throws ProcessException {
        
    }

    void setLogger(ComponentLog logger) {
        
    }

    void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
        ProcessSession session = sessionFactory.createSession()
        try {
            List&amp;lt;FlowFile&amp;gt; flowFiles = session.get(context.getProperty(BATCH_SIZE).asInteger())
            if (!flowFiles) return

            flowFiles.each { FlowFile flowFile -&amp;gt;
                Map customAttributes = [ "mime.type": "application/json" ]
                flowFile = session.write(flowFile, { inputStream, outputStream -&amp;gt;
                    List&amp;lt;Map&amp;gt; searchResults = jsonSlurper.parse(inputStream)
                    searchResults = searchResults.collect { jsonSlurper.parseText(it.SEARCH_RESULT) }
                    outputStream.write(JsonOutput.toJson(searchResults).getBytes(StandardCharsets.UTF_8))
                } as StreamCallback)
                session.putAllAttributes(flowFile, customAttributes)
                session.transfer(flowFile, REL_SUCCESS)
            }
            session.commit()
        } catch (final Throwable t) {
            log.error('{} failed to process due to {}; rolling back session', [this, t] as Object[])
            session.rollback(true)
            throw t
        }
    }
}

processor = new GroovyProcessor()&lt;/LI-CODE&gt;&lt;P&gt;It looks like a lot but most of it is just boilerplate with the actual work being done here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joseomjr_0-1702314052932.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39159i7EBD8B21516393A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joseomjr_0-1702314052932.png" alt="joseomjr_0-1702314052932.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...and the output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joseomjr_1-1702314074829.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39160i26D6D98D0ABB3704/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joseomjr_1-1702314074829.png" alt="joseomjr_1-1702314074829.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2023 17:01:28 GMT</pubDate>
    <dc:creator>joseomjr</dc:creator>
    <dc:date>2023-12-11T17:01:28Z</dc:date>
    <item>
      <title>Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380646#M244113</link>
      <description>&lt;P&gt;I am using ExecuteSQL to pull a colb column from DB. ExecuteSQL provides the result in the avro format. Then I am converting that to Json using AvroToJsonProcessor but it is adding escape characters.&amp;nbsp;&lt;BR /&gt;I want the value that is being pulled from DB as a Json but I am getting it as a string with escape characters.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"SEARCH_RESULT"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"{ &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;requestId&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt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N&gt;firstName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;lastName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Garry&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;}, { &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;firstName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;lastName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Garry&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;} ] } ] }"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I want that value of Search result to be a Json instead of a String so that I can use JOLT to transform it as needed.&amp;nbsp;&lt;BR /&gt;Can you someone pls suggest how to do it.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 15:15:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380646#M244113</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-11T15:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380649#M244116</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106217"&gt;@Anderosn&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Have you tried using ExecuteSQLRecord providing JsonRecordSetWriter as RecordWriter ? This will give you the result in json instead of Avro to begin with.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 15:35:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380649#M244116</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-11T15:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380650#M244117</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;yes I have tried it now, it is also returning the same&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&am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t;SPAN&gt;lastName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Garry&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;} ] } ] }"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 15:46:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380650#M244117</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-11T15:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380654#M244119</link>
      <description>&lt;P&gt;Can you share screenshot of the ExecuteSQL processor configuration? Also it seems from provided output you are getting all\multiple rows result in one flowfile , is this correct? I'm carious to see if you can adjust that by setting the "&lt;SPAN&gt;Max Rows Per Flow File&lt;/SPAN&gt;" property which by default returns everything in 1 flowfile.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 16:17:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380654#M244119</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-11T16:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380656#M244120</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp; in the provided output it is a single record, the column that I am trying to pull is&amp;nbsp; a CLOB on SQL and the query is pulling only one column and the output contains only one record.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExecuteSqlRecrod.PNG" style="width: 855px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39157i5B9B857A4457936B/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExecuteSqlRecrod.PNG" alt="ExecuteSqlRecrod.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 16:25:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380656#M244120</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-11T16:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380661#M244121</link>
      <description>&lt;P&gt;I think you could probably use EvaluateJsonPath to parse the JSON value for "SEARCH_RESULT" but I like scripted processors so I would use a Groovy based InvokeScriptedProcessor with this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import java.nio.charset.StandardCharsets

class GroovyProcessor implements Processor {
    PropertyDescriptor BATCH_SIZE = new PropertyDescriptor.Builder()
        .name("BATCH_SIZE")
        .displayName("Batch Size")
        .description("The number of incoming FlowFiles to process in a single execution of this processor.")
        .required(true)
        .defaultValue("100")
        .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
        .build()

    Relationship REL_SUCCESS = new Relationship.Builder()
        .name("success")
        .description('FlowFiles that were successfully processed are routed here')
        .build()

    Relationship REL_FAILURE = new Relationship.Builder()
        .name("failure")
        .description('FlowFiles that were not successfully processed are routed here')
        .build()

    ComponentLog log
    JsonSlurper jsonSlurper = new JsonSlurper()
    JsonOutput jsonOutput = new JsonOutput()

    void initialize(ProcessorInitializationContext context) {
        log = context.logger
    }

    Set&amp;lt;Relationship&amp;gt; getRelationships() {
        Set&amp;lt;Relationship&amp;gt; relationships = new HashSet&amp;lt;&amp;gt;()
        relationships.add(REL_FAILURE)
        relationships.add(REL_SUCCESS)
        return relationships
    }

    Collection&amp;lt;ValidationResult&amp;gt; validate(ValidationContext context) {
        
    }
    
    PropertyDescriptor getPropertyDescriptor(String name) {
        
    }
    
    void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) {

    }
    
    List&amp;lt;PropertyDescriptor&amp;gt; getPropertyDescriptors() {
        List&amp;lt;PropertyDescriptor&amp;gt; descriptors = new ArrayList&amp;lt;&amp;gt;()
        descriptors.add(BATCH_SIZE)
        return Collections.unmodifiableList(descriptors)
    }
    
    String getIdentifier() {
        
    }

    void onScheduled(ProcessContext context) throws ProcessException {
        
    }

    void onUnscheduled(ProcessContext context) throws ProcessException {
        
    }

    void onStopped(ProcessContext context) throws ProcessException {
        
    }

    void setLogger(ComponentLog logger) {
        
    }

    void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException {
        ProcessSession session = sessionFactory.createSession()
        try {
            List&amp;lt;FlowFile&amp;gt; flowFiles = session.get(context.getProperty(BATCH_SIZE).asInteger())
            if (!flowFiles) return

            flowFiles.each { FlowFile flowFile -&amp;gt;
                Map customAttributes = [ "mime.type": "application/json" ]
                flowFile = session.write(flowFile, { inputStream, outputStream -&amp;gt;
                    List&amp;lt;Map&amp;gt; searchResults = jsonSlurper.parse(inputStream)
                    searchResults = searchResults.collect { jsonSlurper.parseText(it.SEARCH_RESULT) }
                    outputStream.write(JsonOutput.toJson(searchResults).getBytes(StandardCharsets.UTF_8))
                } as StreamCallback)
                session.putAllAttributes(flowFile, customAttributes)
                session.transfer(flowFile, REL_SUCCESS)
            }
            session.commit()
        } catch (final Throwable t) {
            log.error('{} failed to process due to {}; rolling back session', [this, t] as Object[])
            session.rollback(true)
            throw t
        }
    }
}

processor = new GroovyProcessor()&lt;/LI-CODE&gt;&lt;P&gt;It looks like a lot but most of it is just boilerplate with the actual work being done here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joseomjr_0-1702314052932.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39159i7EBD8B21516393A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joseomjr_0-1702314052932.png" alt="joseomjr_0-1702314052932.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...and the output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joseomjr_1-1702314074829.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39160i26D6D98D0ABB3704/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joseomjr_1-1702314074829.png" alt="joseomjr_1-1702314074829.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:01:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380661#M244121</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2023-12-11T17:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380662#M244122</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&amp;nbsp;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).&amp;nbsp;&lt;BR /&gt;Can you pls share how we can get it working using evaluateJsonPath?&lt;BR /&gt;I have tried EvaluteJsonPath using&amp;nbsp;$.[0].SEARCH_RESULT and Return Type as Json&amp;nbsp;&lt;BR /&gt;it is still picking up entire key value pair instead of value itself.&amp;nbsp;&lt;BR /&gt;Output of EvaluteJsonPath&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"SEARCH_RESULT"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"{&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;requestId&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;203680&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;responseData&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: [ {&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;searchKey&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;cardNumber&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt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bsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;firstName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;lastName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Garry&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;} ] } ] }"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Another question if you have array of objects&amp;nbsp;&lt;BR /&gt;how to convert each of them using EvaluteJsonPath?&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:14:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380662#M244122</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-11T17:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380663#M244123</link>
      <description>&lt;P&gt;How about SplitJson&amp;nbsp;&lt;STRONG&gt;$[*]&lt;/STRONG&gt; followed by EvaluateJson&amp;nbsp;&lt;STRONG&gt;$.SEARCH_RESULT&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:35:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380663#M244123</guid>
      <dc:creator>joseomjr</dc:creator>
      <dc:date>2023-12-11T17:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380666#M244126</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/105558"&gt;@joseomjr&lt;/a&gt;&amp;nbsp;tried you suggestion, still seeing the same&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"SEARCH_RESULT"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"{&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;requestId&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;203680&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;responseData&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;: [ {&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;searchKey&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt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&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Garry&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;}, {&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;firstName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;lastName&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;Garry&lt;/SPAN&gt;&lt;SPAN&gt;\"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;} ] } ] }"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Dec 2023 18:01:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380666#M244126</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-11T18:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380667#M244127</link>
      <description>&lt;P&gt;one thing that worked for me use combination of EvaluateJsonPath -&amp;gt; UpdateAttribute -&amp;gt; ReplaceText&lt;BR /&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 18:43:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380667#M244127</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-11T18:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380670#M244128</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106217"&gt;@Anderosn&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Another option is to use the UpdateRecod with an Avro schema in the JsonRecordSetWriter that reflects the actual json structure coming out of the ExecuteSQL&lt;/P&gt;&lt;P&gt;The UpdateRecord will look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_0-1702321845649.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39161iA5875B7CDC8A095C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAMSAL_0-1702321845649.png" alt="SAMSAL_0-1702321845649.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The JsonRecorSetWriter looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_1-1702321891411.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39162iFA3C4EDD19660E18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAMSAL_1-1702321891411.png" alt="SAMSAL_1-1702321891411.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The AvroSchema provided in the ShemaText property is the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"name": "nifi",
	"type": "record",
	"namespace": "nifi.com",
	"fields": [
		{
			"name": "SEARCH_RESULT",
			"type": {
				"name": "SEARCH_RESULT",
				"type": "record",
				"fields": [
					{
						"name": "requestId",
						"type": "string"
					},
					{
						"name": "responseData",
						"type": {
							"name": "responseData",
							"type": "array",
							"items": {
								"name": "responseData",
								"type": "record",
								"fields": [
									{
										"name": "searchKey",
										"type": "string"
									},
									{
										"name": "data",
										"type": {
											"name": "data",
											"type": "array",
											"items": {
												"name": "data",
												"type": "record",
												"fields": [
													{
														"name": "firstName",
														"type": "string"
													},
													{
														"name": "lastName",
														"type": "string"
													}
												]
											}
										}
									}
								]
							}
						}
					}
				]
			}
		}
	]
}&lt;/LI-CODE&gt;&lt;P&gt;This will produce the following output json out of the UpdateRecord:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ {
  "SEARCH_RESULT" : {
    "requestId" : "203680",
    "responseData" : [ {
      "searchKey" : "cardNumber",
      "data" : [ {
        "firstName" : "Martin",
        "lastName" : "Garry"
      }, {
        "firstName" : "Martin",
        "lastName" : "Garry"
      }, {
        "firstName" : "Martin",
        "lastName" : "Garry"
      } ]
    } ]
  }
} ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use EvaluateJsonPath to get the data as json array to do the needed processing.&lt;/P&gt;&lt;P&gt;If that helps please &lt;STRONG&gt;accept&lt;/STRONG&gt; solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 19:14:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380670#M244128</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-11T19:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380701#M244138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;when I try in my local with the schema text that you provided.&lt;BR /&gt;I am seeing this error:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;UpdateRecord[id=&lt;/SPAN&gt;&lt;SPAN&gt;5e779eb4-018c-1000-b9ea-047535bdcfb5&lt;/SPAN&gt;&lt;SPAN&gt;] Failed to write MapRecord[{SEARCH_RESULT=unescapeJson(/SEARCH_RESULT, &lt;/SPAN&gt;&lt;SPAN&gt;'true'&lt;/SPAN&gt;&lt;SPAN&gt;)}] with reader schema [&lt;/SPAN&gt;&lt;SPAN&gt;"SEARCH_RESULT"&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;"STRING"&lt;/SPAN&gt;&lt;SPAN&gt;] and writer schema {&lt;/SPAN&gt;&lt;SPAN&gt;"type"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"record"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"nifi"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"namespace"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"nifi.com"&lt;/SPAN&g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PAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"data"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"fields"&lt;/SPAN&gt;&lt;SPAN&gt;:[{&lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"firstName"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"type"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"string"&lt;/SPAN&gt;&lt;SPAN&gt;},{&lt;/SPAN&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"lastName"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"type"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"string"&lt;/SPAN&gt;&lt;SPAN&gt;}]}}}]}}}]}}]} as a JSON Object due to &lt;/SPAN&gt;&lt;SPAN&gt;org.apache.nifi.serialization.record.util.IllegalTypeConversionException&lt;/SPAN&gt;&lt;SPAN&gt;: Cannot convert value [unescapeJson(/SEARCH_RESULT, &lt;/SPAN&gt;&lt;SPAN&gt;'true'&lt;/SPAN&gt;&lt;SPAN&gt;)] of type class &lt;/SPAN&gt;&lt;SPAN&gt;java.lang.String&lt;/SPAN&gt;&lt;SPAN&gt; to Record for field SEARCH_RESULT&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;org.apache.nifi.serialization.record.util.IllegalTypeConversionException&lt;/SPAN&gt;&lt;SPAN&gt;: Cannot convert value [unescapeJson(/SEARCH_RESULT, &lt;/SPAN&gt;&lt;SPAN&gt;'true'&lt;/SPAN&gt;&lt;SPAN&gt;)] of type class &lt;/SPAN&gt;&lt;SPAN&gt;java.lang.String&lt;/SPAN&gt;&lt;SPAN&gt; to Record for field SEARCH_RESULT&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; at&lt;BR /&gt;Input that I am using is: [{&lt;BR /&gt;"SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }"&lt;BR /&gt;}]&lt;BR /&gt;also tried with&amp;nbsp;&lt;BR /&gt;{&lt;BR /&gt;"SEARCH_RESULT": "{ \"requestId\": \"203680\", \"responseData\": [ { \"searchKey\": \"cardNumber\", \"data\": [ { \"firstName\": \"Martin\", \"lastName\": \"Garry\" }, { \"firstName\": \"Martin\", \"lastName\": \"Garry\"}, { \"firstName\": \"Martin\", \"lastName\": \"Garry\", } ] } ] }"&lt;BR /&gt;}&lt;BR /&gt;org.apache.nifi.serialization.record.util.DataTypeUtils.toRecord(DataTypeUtils.java:444)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:45:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380701#M244138</guid>
      <dc:creator>Anderosn</dc:creator>
      <dc:date>2023-12-12T14:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Avro to Json adding extra delemeters</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380702#M244139</link>
      <description>&lt;P&gt;Can you post screenshot of the UpdateRecord processor configuration? Also you have to be careful with the provided input because there is an extra comma after last Garry value which makes the json invalid.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:57:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Avro-to-Json-adding-extra-delemeters/m-p/380702#M244139</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-12T14:57:21Z</dc:date>
    </item>
  </channel>
</rss>

