[ 
https://issues.apache.org/jira/browse/PIG-2377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

robin zhang tao updated PIG-2377:
---------------------------------

    Attachment: EvalFunc_equals.patch

patch for EvalFunc check return type equals
                
> EvalFunc should use equals() to check equal for ReturnType of 
> Initial/Intermed/Final
> ------------------------------------------------------------------------------------
>
>                 Key: PIG-2377
>                 URL: https://issues.apache.org/jira/browse/PIG-2377
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.9.1
>            Reporter: robin zhang tao
>         Attachments: EvalFunc_equals.patch
>
>
> When EvalFunc check the return type equals with ReturnType of 
> Initial/Intermed/Final, it uses the "==" operator.
> But it should not use "==", but "equals()".
> I have built one UDF, its return type is "Map<String, Long>", and also the 
> Final class returns "Map<String, Long>".
> public class MapLongSum extends EvalFunc<Map<String, Long>> implements 
> Algebraic,
>               Accumulator<Map<String, Long>> {
> ...
> ...
>    static public class Final extends EvalFunc<Map<String, Long>> {
>     ...
>    }
> }
> But Pig always reports error: 
>  Caused by: java.lang.RuntimeException: Final function of 
> com.duowan.yy.etl.log.eval.MapIntSum is not of the expected type.
>         at org.apache.pig.EvalFunc.<init>(EvalFunc.java:146)
>         at com.duowan.yy.etl.log.eval.MapIntSum.<init>(MapIntSum.java:40)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at java.lang.Class.newInstance0(Class.java:355)
>         at java.lang.Class.newInstance(Class.java:308)
>         at 
> org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:474)
>         ... 31 more

--
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

        

Reply via email to