<?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: Pig UDF java.lang.NoSuchMethodError for writing custom UDFs. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244935#M30944</link>
    <description>Hi, 
&lt;BR /&gt;It seems this problem comes from a classloading issue. If you right click on the UDF you created in the repository, you can see the UDF dependencies. By default, Talend uses pig-0.10.jar in order to compile the UDF. The problem is that the cluster you work on uses a more recent version of Pig. You should update it with the correct Pig version. 
&lt;BR /&gt;HTH, 
&lt;BR /&gt;Rémy.</description>
    <pubDate>Tue, 18 Nov 2014 09:32:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-11-18T09:32:47Z</dc:date>
    <item>
      <title>Pig UDF java.lang.NoSuchMethodError for writing custom UDFs.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244933#M30942</link>
      <description>Hi TalendForge, 
&lt;BR /&gt;I'm using 5.4. 
&lt;BR /&gt;I can successfully use the UPPER Pig UDF in a tMap like the following: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBVg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158188i67A1F32574EF882F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBVg.png" alt="0683p000009MBVg.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBUe.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157345iE7A0921F830B4FEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBUe.png" alt="0683p000009MBUe.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;However, if I make my own Pig UDF using Talend's Eval template, which simply sets a string to uppercase, like: 
&lt;BR /&gt; 
&lt;PRE&gt;public class TestUDF extends EvalFunc&amp;lt;String&amp;gt; {&lt;BR /&gt;    public String exec(Tuple input) throws IOException {&lt;BR /&gt;        if (input == null || input.size() == 0) {&lt;BR /&gt;            return null;&lt;BR /&gt;        }&lt;BR /&gt;        try {&lt;BR /&gt;            String str = (String) input.get(0);&lt;BR /&gt;            return str.toUpperCase();&lt;BR /&gt;        } catch (Exception e) {&lt;BR /&gt;            throw new IOException("Caught exception processing input row ", e);&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;And change the tMap to use pigudf.TestUDF(row1.newColumn): 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBVl.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141871iC14A8BED4FEF0C23/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBVl.png" alt="0683p000009MBVl.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;I then get the following error: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.mapred.jobcontrol.JobControl.addJob(Lorg/apache/hadoop/mapred/jobcontrol/Job;)Ljava/lang/String;&lt;BR /&gt;	at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:261)&lt;BR /&gt;	at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:180)&lt;BR /&gt;	at org.apache.pig.PigServer.launchPlan(PigServer.java:1270)&lt;BR /&gt;	at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1255)&lt;BR /&gt;	at org.apache.pig.PigServer.execute(PigServer.java:1245)&lt;BR /&gt;	at org.apache.pig.PigServer.executeBatch(PigServer.java:362)&lt;BR /&gt;	at primehome.pigudf2_0_1.PigUDF2.tPigLoad_1Process(PigUDF2.java:757)&lt;BR /&gt;	at primehome.pigudf2_0_1.PigUDF2.runJobInTOS(PigUDF2.java:1071)&lt;BR /&gt;	at primehome.pigudf2_0_1.PigUDF2.main(PigUDF2.java:936)&lt;BR /&gt; disconnected&lt;BR /&gt;Job PigUDF2 ended at 13:29 04/11/2014. &lt;/PRE&gt; 
&lt;BR /&gt;In fact, if I change the UDF back to UPPER which originally worked, the job will still fail with the same error. I have to create a new job to get rid of this error. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Matthew</description>
      <pubDate>Sat, 16 Nov 2024 11:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244933#M30942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Pig UDF java.lang.NoSuchMethodError for writing custom UDFs.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244934#M30943</link>
      <description>Hello,
&lt;BR /&gt;Can you please create a JIRA issue in our issue tracker ?&amp;nbsp;https://jira.talendforge.org
&lt;BR /&gt;You can create it in the TBD project.
&lt;BR /&gt;Thanks in advance,
&lt;BR /&gt;Regards,
&lt;BR /&gt;Rémy.</description>
      <pubDate>Sun, 09 Nov 2014 12:48:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244934#M30943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-09T12:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pig UDF java.lang.NoSuchMethodError for writing custom UDFs.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244935#M30944</link>
      <description>Hi, 
&lt;BR /&gt;It seems this problem comes from a classloading issue. If you right click on the UDF you created in the repository, you can see the UDF dependencies. By default, Talend uses pig-0.10.jar in order to compile the UDF. The problem is that the cluster you work on uses a more recent version of Pig. You should update it with the correct Pig version. 
&lt;BR /&gt;HTH, 
&lt;BR /&gt;Rémy.</description>
      <pubDate>Tue, 18 Nov 2014 09:32:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Pig-UDF-java-lang-NoSuchMethodError-for-writing-custom-UDFs/m-p/2244935#M30944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T09:32:47Z</dc:date>
    </item>
  </channel>
</rss>

