<?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: Example for Dynamic Invokers in Pig?? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100252#M13196</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt; I tried the StringConcat and it didn't work, even though GenericInvoker does accept functions that are not Static. InvokeForString('java.lang.String.concat', 'String String', 'false') with false being isStatic didn't work for me. I ping the Pig mailing list, will see. It is pretty limiting with only primitives and only static methods, that's a shame!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Dec 2015 01:50:49 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2015-12-25T01:50:49Z</dc:date>
    <item>
      <title>Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100247#M13191</link>
      <description>&lt;P&gt;I have seen URLDecoder as an example for Pig Dynamic Invokers. Can i have more examples like String related functions  or may be other that pig use as dynamic invokers?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:43:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100247#M13191</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2015-12-21T21:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100248#M13192</link>
      <description>&lt;P&gt;awesome question, didn't even know this exists but digging through Pig source code, here are some examples &lt;A href="https://github.com/apache/pig/blob/a44b85a0ab941cdd1d2d7f6e457303aef1e57501/src/org/apache/pig/builtin/GenericInvoker.java"&gt;https://github.com/apache/pig/blob/a44b85a0ab941cd...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-- invoking a static method&lt;/P&gt;&lt;P&gt;DEFINE StringToLong InvokeForLong('java.lang.Long.valueOf', 'String') ;&lt;/P&gt;&lt;P&gt;longs = FOREACH strings GENERATE StringToLong(some_chararray);&lt;/P&gt;&lt;P&gt;-- invoking a method on an object&lt;/P&gt;&lt;P&gt;DEFINE StringConcat InvokeForString('java.lang.String.concat', 'String String', 'false') ;&lt;/P&gt;&lt;P&gt;concatenations = FOREACH strings GENERATE StringConcat(str1, str2); 
&lt;/P&gt;&lt;P&gt;and here are test cases that you can probably look for examples &lt;A href="https://github.com/apache/pig/blob/a44b85a0ab941cdd1d2d7f6e457303aef1e57501/test/org/apache/pig/test/TestInvoker.java"&gt;https://github.com/apache/pig/blob/a44b85a0ab941cd...&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 12:01:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100248#M13192</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-12-24T12:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100249#M13193</link>
      <description>&lt;P&gt;pig is awesome...&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 12:54:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100249#M13193</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2015-12-24T12:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100250#M13194</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/393/aervits.html"&gt;Artem Ervits&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Is StringConcat function that you defined working for you??? I am encountering following error.&lt;/P&gt;&lt;P&gt;Caused by: java.lang.NoSuchMethodException: java.lang.String.concat()
        at java.lang.Class.getMethod(Class.java:1665)
        at org.apache.pig.builtin.Invoker.&amp;lt;init&amp;gt;(Invoker.java:88)
        at org.apache.pig.builtin.GenericInvoker.&amp;lt;init&amp;gt;(GenericInvoker.java:90)
        at org.apache.pig.builtin.InvokeForString.&amp;lt;init&amp;gt;(InvokeForString.java:40)
        ... 39 more&lt;/P&gt;&lt;P&gt;I am not sure whether Pig Dynamic Invokes work for functions other than "Static".&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 13:11:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100250#M13194</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2015-12-24T13:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100251#M13195</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt; The string concat example is from the tests of dynamic invokers, I didn't create it. Here are some comments from the source code&lt;/P&gt;/** need more tests -- non-String funcs and especially the full path through the pig interpreter.  * I tested manually, seems to work, but * should really add more here.&lt;P&gt;It's passing their tests so I assume it does work. I will test it at some point. If you want a speedier answer, perhaps you can ping the Pig mailing list? I'm so glad you brought this up, I see how this feature can be really handy and it's been available since Pig 0.8! Here's some more info on it &lt;A href="https://squarecog.wordpress.com/?s=dynamic+invoker" target="_blank"&gt;https://squarecog.wordpress.com/?s=dynamic+invoker&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 21:58:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100251#M13195</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-12-24T21:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100252#M13196</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt; I tried the StringConcat and it didn't work, even though GenericInvoker does accept functions that are not Static. InvokeForString('java.lang.String.concat', 'String String', 'false') with false being isStatic didn't work for me. I ping the Pig mailing list, will see. It is pretty limiting with only primitives and only static methods, that's a shame!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 01:50:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100252#M13196</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-12-25T01:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Dynamic Invokers in Pig??</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100253#M13197</link>
      <description>&lt;P&gt;Here's the original post &lt;A href="https://pig.apache.org/docs/r0.15.0/api/org/apache/pig/builtin/GenericInvoker.html" target="_blank"&gt;https://pig.apache.org/docs/r0.15.0/api/org/apache/pig/builtin/GenericInvoker.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 01:52:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Example-for-Dynamic-Invokers-in-Pig/m-p/100253#M13197</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-12-25T01:52:26Z</dc:date>
    </item>
  </channel>
</rss>

