[
https://issues.apache.org/jira/browse/PIG-2317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130342#comment-13130342
]
Jonathan Coveney commented on PIG-2317:
---------------------------------------
I agree on the style points, and will implement accordingly.
As far as the Algebraic UDF's, I can simplify them greatly. The nested
structure was largely a vestige of an initial, poor implementation.
{code}
class SUM < AlgebraicPigUDF
outputSchema "val:long"
def initial item
item
end
def intermed items
items.flatten.inject(:+)
end
def final items
intermed items
end
end
{code}
Extremely compact.
Another fun thing that could be a boon to doing serious analysis in a scripting
language (as something similar could no doubt be done in Jython): I am working
on making a native ruby object that wraps the DataBag. There are a couple of
hacky ways of doing it, but I'm hoping to do one in a real, fast way. It should
ideally allow us to avoid materializing bags into memory in scripting languages.
> 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: PigUdf.rb, PigUdf.rb, jruby_scripting.patch,
> jruby_scripting_2_real.patch, jruby_scripting_3.patch,
> jruby_scripting_4.patch, jruby_scripting_5.patch, pigjruby.rb, pigjruby.rb
>
>
> 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