<?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: Nifi  JoltTransformationJson for Operation : modify-overwrite-beta to use concat function in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JoltTransformationJson-for-Operation-modify-overwrite/m-p/166373#M45386</link>
    <description>&lt;P&gt;
	Hi 
	&lt;A rel="user" href="https://community.cloudera.com/users/13387/srinivaspadalacs.html" nodeid="13387"&gt;@srini&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;
	NiFi does support the addition of custom transformations which can be referenced with a "drop in" jar.  You could create your own transformation class, which extends the jolt library, that provides the functionality you need and be available to NiFi on the file system.  Given that this is a new function in a later version of Jolt I would be careful using that the as a custom jar; that may cause a conflict but I haven't tested this myself to be sure.&lt;/P&gt;&lt;P&gt;Below are some use cases on how to apply custom functions in NiFi  &lt;/P&gt;&lt;P&gt;
	Case 1 – Custom Transform Selected&lt;/P&gt;&lt;P&gt;
	In this case if the Custom option of  Transform  is selected then 1) a Custom Transform Class Name should be entered and 2) one or more module paths should be provided. The Custom Transform Class Name should be a fully qualified classname (e.g. eu.zacheusz.jolt.date.Dater). The Module Path can take a comma delimited list of directory locations or one or more jar files. Once these fields are populated the Advanced view will support validation and saving of the specification. A user can switch between transformation types in the UI but not custom class names &amp;amp; module paths.&lt;/P&gt;&lt;P&gt;
	&lt;IMG src="https://ip1.i.lithium.com/339686033d71c42346251c14be0f13607c20f0f2/68747470733a2f2f636c6f75642e67697468756275736572636f6e74656e742e636f6d2f6173736574732f313337313835382f31363239313335312f66666165373733362d333864332d313165362d396234302d3438636563616636346437372e6a7067" /&gt;&lt;/P&gt;&lt;P&gt;
	Case 2 – Chain Transformation Selected with Custom Transformations embedded&lt;/P&gt;&lt;P&gt;
	In this case if you wants to use one or more transforms (that include custom transformations) in your specification then the Chainr spec option can be used with one or more module path provides. In this case the Custom Transform Class Name property is not required and would be ignored (since one or more custom transformations could be invoked in the spec). As in Case 1 the Advanced view will support validation and saving of specification if the required fields are populated for this case.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/ce878a30acd0c246863a6ecfa239c044370d1beb/68747470733a2f2f636c6f75642e67697468756275736572636f6e74656e742e636f6d2f6173736574732f313337313835382f31363239313335342f30323962626232612d333864342d313165362d383864632d3762643936383966336138332e6a7067" /&gt;&lt;/P&gt;&lt;P&gt;I hope this helps! Please let me know if you have any questions.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2016 10:09:08 GMT</pubDate>
    <dc:creator>ydavis</dc:creator>
    <dc:date>2016-11-07T10:09:08Z</dc:date>
    <item>
      <title>Nifi  JoltTransformationJson for Operation : modify-overwrite-beta to use concat function</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JoltTransformationJson-for-Operation-modify-overwrite/m-p/166372#M45385</link>
      <description>&lt;P&gt;The below input and script is working in &lt;A href="http://jolt-demo.appspot.com/#andrewkcarter2" target="_blank"&gt;http://jolt-demo.appspot.com/#andrewkcarter2&lt;/A&gt; , But it is not working in Nifi JolttransformationJson .
This example is concatenation of firstname and lastname .&lt;/P&gt;&lt;P&gt;I understood it is becuase of not having "Operation : modify-overwrite-beta" in existing Nifi - JoltTransformation plugin . 
Is it possible to get this function by custom ? If yes, Please provide the process to implement . 
or let us know the process to ultilize it . Thanks .&lt;/P&gt;&lt;P&gt;  @&lt;A href="https://community.hortonworks.com/users/3136/ydavis.html"&gt;Yolanda M. Davis&lt;/A&gt;  - Please through some light on this .Thanks . &lt;/P&gt;&lt;PRE&gt;Input :
{
	"data": [{
		"IDF": "123",
		"FirstName": "George",
		"LastName": "Kosher",
		"PaymentInfo": [{
			"Type": "ABC",
			"Text": "Soft",
			"Amount": 3
		}, {
			"Type": "ABC",
			"Text": "Text",
			"Amount": 5
		}],
		"PaymentCard": [{
			"CardNumber": "12345",
			"CardType": "Credit"
		}, {
			"CardNumber": "56789",
			"CardType": "Credit"
		}]
	}, {
		"IDF": "456",
		"FirstName": "Mill",
		"LastName": "King",
		"PaymentInfo": [{
			"Type": "ABC",
			"InstructionText": "Hard",
			"Amount": 6
		}, {
			"Type": "ABC",
			"InstructionText": "Text",
			"Amount": 8
		}],
		"PaymentCard": [{
			"CardNumber": "12345",
			"CardType": "Credit"
		}, {
			"CardNumber": "56789",
			"CardType": "Credit"
		}]
	}]
}


Script : 
[
  {
    "operation": "shift",
    "spec": {
      "data": {
        "*": { // data arrayf
          "*": "data[&amp;amp;1].&amp;amp;", // pass thru stuff
          "PaymentInfo": {
            "*": {
              "Amount": "data[&amp;amp;3].Amount[]",
              "Text": "data[&amp;amp;3].PaymentText[]",
              "InstructionText": "data[&amp;amp;3].PaymentText[]"
            }
          },
          "PaymentCard": {
            "0": {
              "CardType": "data[&amp;amp;3].CardType"
            }
          }
        }
      }
    }
  },
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "data": {
        "*": { // data array
          "Name": "=concat(@(1,FirstName),' ',@(1,LastName))",
          "Amount": "=sum" // should work on Jolt 0.0.24
        }
      }
    }
  },
  {
    "operation": "remove",
    "spec": {
      "data": {
        "*": { // data array
          "FirstName": "",
          "LastName": ""
        }
      }
    }
  }
]

Output : 


{
  "data" : [ {
    "IDF" : "123",
    "Amount" : [ 3, 5 ],
    "PaymentText" : [ "Soft", "Text" ],
    "CardType" : "Credit",
    "Name" : "George Kosher"
  }, {
    "IDF" : "456",
    "Amount" : [ 6, 8 ],
    "PaymentText" : [ "Hard", "Text" ],
    "CardType" : "Credit",
    "Name" : "Mill King"
  } ]
}


&lt;/PRE&gt;</description>
      <pubDate>Sat, 05 Nov 2016 12:22:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JoltTransformationJson-for-Operation-modify-overwrite/m-p/166372#M45385</guid>
      <dc:creator>srinivaspadala_</dc:creator>
      <dc:date>2016-11-05T12:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi  JoltTransformationJson for Operation : modify-overwrite-beta to use concat function</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JoltTransformationJson-for-Operation-modify-overwrite/m-p/166373#M45386</link>
      <description>&lt;P&gt;
	Hi 
	&lt;A rel="user" href="https://community.cloudera.com/users/13387/srinivaspadalacs.html" nodeid="13387"&gt;@srini&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;
	NiFi does support the addition of custom transformations which can be referenced with a "drop in" jar.  You could create your own transformation class, which extends the jolt library, that provides the functionality you need and be available to NiFi on the file system.  Given that this is a new function in a later version of Jolt I would be careful using that the as a custom jar; that may cause a conflict but I haven't tested this myself to be sure.&lt;/P&gt;&lt;P&gt;Below are some use cases on how to apply custom functions in NiFi  &lt;/P&gt;&lt;P&gt;
	Case 1 – Custom Transform Selected&lt;/P&gt;&lt;P&gt;
	In this case if the Custom option of  Transform  is selected then 1) a Custom Transform Class Name should be entered and 2) one or more module paths should be provided. The Custom Transform Class Name should be a fully qualified classname (e.g. eu.zacheusz.jolt.date.Dater). The Module Path can take a comma delimited list of directory locations or one or more jar files. Once these fields are populated the Advanced view will support validation and saving of the specification. A user can switch between transformation types in the UI but not custom class names &amp;amp; module paths.&lt;/P&gt;&lt;P&gt;
	&lt;IMG src="https://ip1.i.lithium.com/339686033d71c42346251c14be0f13607c20f0f2/68747470733a2f2f636c6f75642e67697468756275736572636f6e74656e742e636f6d2f6173736574732f313337313835382f31363239313335312f66666165373733362d333864332d313165362d396234302d3438636563616636346437372e6a7067" /&gt;&lt;/P&gt;&lt;P&gt;
	Case 2 – Chain Transformation Selected with Custom Transformations embedded&lt;/P&gt;&lt;P&gt;
	In this case if you wants to use one or more transforms (that include custom transformations) in your specification then the Chainr spec option can be used with one or more module path provides. In this case the Custom Transform Class Name property is not required and would be ignored (since one or more custom transformations could be invoked in the spec). As in Case 1 the Advanced view will support validation and saving of specification if the required fields are populated for this case.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/ce878a30acd0c246863a6ecfa239c044370d1beb/68747470733a2f2f636c6f75642e67697468756275736572636f6e74656e742e636f6d2f6173736574732f313337313835382f31363239313335342f30323962626232612d333864342d313165362d383864632d3762643936383966336138332e6a7067" /&gt;&lt;/P&gt;&lt;P&gt;I hope this helps! Please let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 10:09:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Nifi-JoltTransformationJson-for-Operation-modify-overwrite/m-p/166373#M45386</guid>
      <dc:creator>ydavis</dc:creator>
      <dc:date>2016-11-07T10:09:08Z</dc:date>
    </item>
  </channel>
</rss>

