Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> jython udfs


+
Stan Rosenberg 2011-10-12, 23:29
+
Jonathan Coveney 2011-10-13, 00:49
Copy link to this message
-
Re: jython udfs
Also the output schema for dummy3() doesn't match what's being returned.
 You're returning a list of strings, but the outputschema specifies a bag,
which translates into a list of tuples (of something, eg. strings).

Norbert

On Wed, Oct 12, 2011 at 7:29 PM, Stan Rosenberg <
[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have three constant udfs in jython:
>
> @outputSchema("m:map[bag{tuple()}]")
> def dummy1():
>    return {"key":[("value1", "value2")]}
>
> @outputSchema("m:map[tuple()]")
> def dummy2():
>    return {"key":("value1", "value2")}
>
> # doesn't work!
> @outputSchema("m:map[bag{}]")
> def dummy3():
>    return {"key":["value1", "value2"]}
>
>
> The first two are fine. The last one which returns a map whose values
> are lists does not work.  (I am getting ClassCastException:
> java.lang.String cannot be cast to org.apache.pig.data.Tuple).
> Could somebody explain why?
>
> Thanks,
>
> stan
>
+
Stan Rosenberg 2011-10-13, 19:46
+
Thejas Nair 2011-10-13, 20:57
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB