[
https://issues.apache.org/jira/browse/PIG-2317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13127732#comment-13127732
]
Jonathan Coveney commented on PIG-2317:
---------------------------------------
My pleasure to help :)
Hmm, I think it's worth seeing if we can do this without breaking 0.9
compatibility...a lot of shops aren't even on 0.9 yet, so requiring 0.10 is
gonna severely limiting potential users.
I see your issue on the ruby script end and agree...and I think there are a
couple of solutions.
1) we explicitly make people extend a class in order to write a UDF. Then, we
could just give them a gem that defines all of this stuff, and they can require
'pigudf' or whatever.
2) we provide a ruby function which does the wrapping for the user, and then
they can run it... so you type "gimmeruby myudfs.rb"
The second approach is much simpler and would still let people test things
independent of pig. The first approach seems to me the "right" approach. Also,
it'd have the nice side effect that you could easily extend it to manipulate
pig objects on the ruby end more easily. For example: right now, while
technically you could create your own schema objects in jruby...good luck (all
of the scripting UDFs suffer from this). It'd be pretty nasty, because you'd be
creating a bunch of java objects and whatnot. But we could easily just extend
it in the gem and bam, provide utilities like that...
Anything else pinging around your brain?
> Ruby/Jruby UDFs
> ---------------
>
> Key: PIG-2317
> URL: https://issues.apache.org/jira/browse/PIG-2317
> Project: Pig
> Issue Type: New Feature
> Reporter: Jacob Perkins
> Assignee: Jacob Perkins
> Priority: Minor
> Fix For: 0.9.2
>
> Attachments: jruby_scripting.patch, jruby_scripting_2_real.patch
>
>
> It should be possible to write UDFs in Ruby. These UDFs will be registered in
> the same way as python and javascript UDFs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira