v0.2.5 released

2 views
Skip to first unread message

Theo Hultberg

unread,
Jan 16, 2010, 5:11:39 PM1/16/10
to pigle...@googlegroups.com
Piglet v0.2.5 is now available from Gemcutter.org.

I've added support for %declare and %define, and some UDF magic.

If you define a UDF like this:

define 'my_udf', :function => 'com.example.Foo'

you can use it in field context like this:

a.foreach { |r| [my_udf(r[0]).as(:awesome)] }

which would result in this Pig Latin code:

FOREACH a GENERATE my_udf($0) AS awesome

cool, huh?

T#

Dmitriy Ryaboy

unread,
Jan 16, 2010, 5:30:00 PM1/16/10
to pigle...@googlegroups.com
Theo,
That's way cool. You're moving this thing fast.
Looks like at the moment you can't pass initialization parameters to
defined UDFs, other than as part of the function string?

-D

Theo Hultberg

unread,
Jan 17, 2010, 6:19:06 AM1/17/10
to pigle...@googlegroups.com
> Looks like at the moment you can't pass initialization parameters to
> defined UDFs, other than as part of the function string?

nope, the string passed to :function => will be output verbatim, so
that's the way to go now. give me a Pig Latin example of what you want
to do and I'll add it to Piglet (may oversights on my part are due to
my inexperience with many aspects of Pig Latin, I have yet to use UDFs
for example).

T#

Reply all
Reply to author
Forward
0 new messages