<?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: How to transform Oracle database output to desired format using Apache NiFi? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365344#M239326</link>
    <description>&lt;P&gt;Still, I am not able to replace&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;{ "type":"record", "name":"nifiRecord", "namespace":"org.apache.nifi",&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;to&lt;/STRONG&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{ "type": "record", "name": "Bank", "namespace": "com.xyz.model.vo", "fields":&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Mar 2023 22:05:25 GMT</pubDate>
    <dc:creator>Shanoj</dc:creator>
    <dc:date>2023-03-05T22:05:25Z</dc:date>
    <item>
      <title>How to transform Oracle database output to desired format using Apache NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365338#M239324</link>
      <description>&lt;P&gt;How can I use Apache NiFi to transform the current output of my Oracle database to the desired output format, as shown below? Desier out should be as mention below Avro format&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Current output:&lt;BR /&gt;&lt;BR /&gt;{ "type":"record", "name":"nifiRecord", "namespace":"org.apache.nifi", "fields":[ {"name":"AGENT_CODE", "type":["null","string"]}, {"name":"CORR_ACC_NO", "type":["null","string"]}, {"name":"LOCAL_ACC_NO", "type":["null","string"]} ] }&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Desired output:&lt;BR /&gt;&lt;BR /&gt;{ "type": "record", "name": "Bank", "namespace": "com.xyz.model.vo", "fields":[ {"name": "instance", "type": "string"}, {"name": "agent_code", "type": "string"}, {"name": "corr_acc_no", "type": "long"}, {"name": "local_acc_no", "type": "string"} ] }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What steps do I need to take in NiFi to achieve this transformation and output the results to the desired format? especially for changing&amp;nbsp;{ "type": "record", "name": "Bank", "namespace": "com.xyz.model.vo"&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2023 02:55:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365338#M239324</guid>
      <dc:creator>Shanoj</dc:creator>
      <dc:date>2023-03-05T02:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform Oracle database output to desired format using Apache NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365341#M239325</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have few options like UpdateRecord Processor or JoltJsonTrnasformation. I recommend the UpdateRecord , for more information on how to use please refer to :&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.UpdateRecord/" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.UpdateRecord/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.UpdateRecord/additionalDetails.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.UpdateRecord/additionalDetails.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It should be straight forward if you use the "Replace with Literal" strategy.&lt;/P&gt;&lt;P&gt;If that helps please accept solution&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2023 14:39:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365341#M239325</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-03-05T14:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform Oracle database output to desired format using Apache NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365344#M239326</link>
      <description>&lt;P&gt;Still, I am not able to replace&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;{ "type":"record", "name":"nifiRecord", "namespace":"org.apache.nifi",&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;to&lt;/STRONG&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{ "type": "record", "name": "Bank", "namespace": "com.xyz.model.vo", "fields":&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2023 22:05:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365344#M239326</guid>
      <dc:creator>Shanoj</dc:creator>
      <dc:date>2023-03-05T22:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform Oracle database output to desired format using Apache NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365349#M239329</link>
      <description>&lt;P&gt;I apologize, I forgot that you are talking about an Avro format and not json. In this I think you need to pass your own avro schema. You can first convert Avro to Json using ConvertAvroToJSON processor , then use ConvertRecrod which can be configured as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_0-1678063001801.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36906i1B3437690F3F85DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAMSAL_0-1678063001801.png" alt="SAMSAL_0-1678063001801.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the AvroRecordWrite , you can set your schema with the proper record\namespace values. For Example in my case I used the "User Schema Text" strategy and either provide the schema directly in the Schema Text Property or reference it using flowfile attribute ${avro.schema} using Expression Language.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_1-1678063208276.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/36907i8FD6B15CCEBE6171/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAMSAL_1-1678063208276.png" alt="SAMSAL_1-1678063208276.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Schema Text :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"type": "record",
	"name": "bank",
	"namespace": "org.xyz.com",
	"fields": [
		{
			"name": "AGENT_CODE",
			"type": [
				"null",
				"string"
			]
		},
		{
			"name": "CORR_ACC_NO",
			"type": [
				"null",
				"string"
			]
		},
		{
			"name": "LOCAL_ACC_NO",
			"type": [
				"null",
				"string"
			]
		}
	]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 00:40:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-transform-Oracle-database-output-to-desired-format/m-p/365349#M239329</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-03-06T00:40:49Z</dc:date>
    </item>
  </channel>
</rss>

