<?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>topic Re: Custom Spark code through tjava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326031#M95561</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;these is a example code for tJava with Spark job. the code&amp;nbsp; sample of the component is wrong&amp;nbsp; ( Talend 6.4.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the basic setting :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;outputrdd_tJava_1 = rdd_tJava_1.map(new mapInToOut(job)).&lt;/PRE&gt;&lt;P&gt;in the advanced setting, in class&amp;nbsp; java field&lt;/P&gt;&lt;PRE&gt;	public static class mapInToOut
			implements
			org.apache.spark.api.java.function.Function&amp;lt;inputStruct, RecordOut_tJava_1&amp;gt; {

		private ContextProperties context = null;
        private java.util.List&amp;lt;org.apache.avro.Schema.Field&amp;gt; fieldsList;
		
		public mapInToOut(JobConf job) {
			this.context = new ContextProperties(job);
		}
		
		@Override
		public RecordOut_tJava_1 call(inputStruct origStruct) {		
			
		if (fieldsList == null) {
				this.fieldsList = (new inputStruct()).getSchema()
						.getFields();
			}

			RecordOut_tJava_1 value = new RecordOut_tJava_1();

			for (org.apache.avro.Schema.Field field : fieldsList) {
				value.put(field.pos(), origStruct.get(field.pos()));
			}

			return value;		
			
		}
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2017 16:34:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-24T16:34:45Z</dc:date>
    <item>
      <title>Custom Spark code through tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326027#M95557</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any wordcount like example available on how to integrate our already written custom spark code in talend.I checked the knowledge base and could see tjava for spark supports it but I am not able to find an example to understand the syntax described in the component comments.&lt;/P&gt;
&lt;P&gt;Any help will be much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Ojasvi Gambhir&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:20:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326027#M95557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Spark code through tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326028#M95558</link>
      <description>&lt;P&gt;Hi Ojasvi&lt;/P&gt; 
  &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
  &lt;P&gt;You can check the below code for your reference and can customize according to your requirement:&lt;/P&gt; 
  &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
  &lt;DIV&gt; 
   &lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN&gt;package&lt;/SPAN&gt; &lt;SPAN&gt;PackageDemo&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt; 
  &lt;/DIV&gt; 
  &lt;DIV&gt;
    &amp;nbsp; 
  &lt;/DIV&gt; 
  &lt;DIV&gt; 
   &lt;DIV&gt;
     &amp;nbsp; 
   &lt;/DIV&gt; 
   &lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;java&lt;/SPAN&gt;.&lt;SPAN&gt;io&lt;/SPAN&gt;.&lt;SPAN&gt;IOException&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt; 
  &lt;/DIV&gt; 
  &lt;DIV&gt; 
   &lt;DIV&gt;
     &amp;nbsp; 
   &lt;/DIV&gt; 
   &lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;org&lt;/SPAN&gt;.&lt;SPAN&gt;apache&lt;/SPAN&gt;.&lt;SPAN&gt;hadoop&lt;/SPAN&gt;.&lt;SPAN&gt;conf&lt;/SPAN&gt;.&lt;SPAN&gt;Configuration&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt; 
  &lt;/DIV&gt; 
  &lt;DIV&gt; 
   &lt;DIV&gt;
     &amp;nbsp; 
   &lt;/DIV&gt; 
   &lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;org&lt;/SPAN&gt;.&lt;SPAN&gt;apache&lt;/SPAN&gt;.&lt;SPAN&gt;hadoop&lt;/SPAN&gt;.&lt;SPAN&gt;fs&lt;/SPAN&gt;.&lt;SPAN&gt;Path&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt; 
  &lt;/DIV&gt; 
  &lt;DIV&gt; 
   &lt;DIV&gt;
     &amp;nbsp; 
   &lt;/DIV&gt; 
   &lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;org&lt;/SPAN&gt;.&lt;SPAN&gt;apache&lt;/SPAN&gt;.&lt;SPAN&gt;hadoop&lt;/SPAN&gt;..&lt;/SPAN&gt;&lt;/PRE&gt;
  &lt;/DIV&gt;
 &lt;BR /&gt;&lt;BR /&gt;To see the whole post, download it &lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009MdDD"&gt;here&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009MdDD"&gt;OriginalPost.pdf&lt;/A&gt;</description>
      <pubDate>Fri, 01 Sep 2017 07:14:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326028#M95558</guid>
      <dc:creator>Irshad1</dc:creator>
      <dc:date>2017-09-01T07:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Spark code through tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326029#M95559</link>
      <description>&lt;P&gt;thank you fuzzyedy&amp;nbsp; for you quick response.&lt;/P&gt;
&lt;P&gt;Will this code work for spark job tjava component .&lt;/P&gt;
&lt;P&gt;My requirement basically is to know how to write spark custom code in tjava component with talend specified syntax present as comments in tjava component for spark, I do have code for wordcount in java spark but not able to integrate with tjava nomenclature.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks and regards,&lt;/P&gt;
&lt;P&gt;Ojasvi Gambhir&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 08:00:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326029#M95559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-01T08:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Spark code through tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326030#M95560</link>
      <description>&lt;P&gt;yes , this should work. Go and give a try!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;goodluck!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 15:19:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326030#M95560</guid>
      <dc:creator>Irshad1</dc:creator>
      <dc:date>2017-09-12T15:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Spark code through tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326031#M95561</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;these is a example code for tJava with Spark job. the code&amp;nbsp; sample of the component is wrong&amp;nbsp; ( Talend 6.4.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the basic setting :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;outputrdd_tJava_1 = rdd_tJava_1.map(new mapInToOut(job)).&lt;/PRE&gt;&lt;P&gt;in the advanced setting, in class&amp;nbsp; java field&lt;/P&gt;&lt;PRE&gt;	public static class mapInToOut
			implements
			org.apache.spark.api.java.function.Function&amp;lt;inputStruct, RecordOut_tJava_1&amp;gt; {

		private ContextProperties context = null;
        private java.util.List&amp;lt;org.apache.avro.Schema.Field&amp;gt; fieldsList;
		
		public mapInToOut(JobConf job) {
			this.context = new ContextProperties(job);
		}
		
		@Override
		public RecordOut_tJava_1 call(inputStruct origStruct) {		
			
		if (fieldsList == null) {
				this.fieldsList = (new inputStruct()).getSchema()
						.getFields();
			}

			RecordOut_tJava_1 value = new RecordOut_tJava_1();

			for (org.apache.avro.Schema.Field field : fieldsList) {
				value.put(field.pos(), origStruct.get(field.pos()));
			}

			return value;		
			
		}
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 16:34:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326031#M95561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-24T16:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Spark code through tjava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326032#M95562</link>
      <description>&lt;P&gt;Hi emenuet,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you&amp;nbsp;tried this&amp;nbsp;with spark 2.x as well?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Dhaval&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 06:07:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Custom-Spark-code-through-tjava/m-p/2326032#M95562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-07T06:07:46Z</dc:date>
    </item>
  </channel>
</rss>

