pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitriy V. Ryaboy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIG-969) Default constructor of UDF gets called for UDF with parameterised constructor , if the udf has a getArgToFuncMapping function defined
Date Mon, 14 Feb 2011 23:25:57 GMT

    [ https://issues.apache.org/jira/browse/PIG-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994556#comment-12994556
] 

Dmitriy V. Ryaboy commented on PIG-969:
---------------------------------------

Hm I might have added that in a different ticket. 

> Default constructor of UDF gets called for UDF with parameterised constructor , if the
udf has a getArgToFuncMapping function defined
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-969
>                 URL: https://issues.apache.org/jira/browse/PIG-969
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>            Reporter: Thejas M Nair
>            Assignee: Thejas M Nair
>             Fix For: 0.9.0
>
>
> This issue is discussed in  http://www.mail-archive.com/pig-user@hadoop.apache.org/msg00524.html
. I am able to reproduce the issue. While it is easy to fix the udf, it can take a lot of
time to figure out the problem (until they find this email conversation!).
> The root cause is that when getArgToFuncMapping is defined in the udf , the FuncSpec
returned by the method replaces one set by define statement . The constructor arguments get
lost.  We can handle this in following ways -
> 1. Preserve the constructor arguments, and use it with the class name of the matching
FuncSpec from getArgToFuncMapping . 
> 2. Give an error if constructor paramerters are given for a udf which has FuncSpecs returned
from getArgToFuncMapping .
> The problem with  approach 1 is that we are letting the user define the FuncSpec , so
user could have defined a FuncSpec with constructor (though they don't have a valid reason
to do so.). It is also possible the the constructor of the different class that matched might
not support same constructor parameters. The use of this function outside builtin udfs are
also probably not common.
> With option 2, we are telling the user that this is not a supported use case, and user
can easily change the udf to fix the issue, or use the udf which would have matched given
parameters (which unlikely to have the getArgToFuncMapping method defined).
> I am proposing that we go with option 2 . 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message