You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Aniket Mokashi (JIRA)" <ji...@apache.org> on 2013/10/11 20:02:42 UTC
[jira] [Commented] (PIG-3451) EvalFunc ctor reflection to
determine value of type param T is brittle
[ https://issues.apache.org/jira/browse/PIG-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792880#comment-13792880 ]
Aniket Mokashi commented on PIG-3451:
-------------------------------------
+1
I found out that the test failures are not related to this change.
I will fix some formatting changes and commit this patch to trunk.
> EvalFunc<T> ctor reflection to determine value of type param T is brittle
> -------------------------------------------------------------------------
>
> Key: PIG-3451
> URL: https://issues.apache.org/jira/browse/PIG-3451
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.11.1
> Reporter: Andy Schlaikjer
> Assignee: Andy Schlaikjer
> Fix For: 0.13.0
>
> Attachments: PIG-3451-3.patch
>
>
> The {{EvalFunc<T>}} base class has logic in its default ctor to attempt to determine the runtime type of its type parameter {{T}}. This logic is brittle when the derived class has type parameters of its own. For instance:
> {code}
> public static abstract EvalFunc1<T> extends EvalFunc<T> {}
> public static abstract EvalFunc2<X, T> extends EvalFunc1<T> {}
> public static EvalFunc3<X> extends EvalFunc1<X, DataBag> { ... }
> {code}
> Here, {{EvalFunc3<X>}} does specify concrete type {{DataBag}} for {{T}} of {{EvalFunc<T>}}, but the existing logic in the default ctor fails to identify it.
> Here's a unit test which reproduces this failure:
> https://github.com/sagemintblue/pig/compare/apache:trunk...hazen/repro_eval_func_reflection_bug
> Here's the test with an update to {{EvalFunc}}'s logic which fixes the issue:
> https://github.com/sagemintblue/pig/compare/apache:trunk...hazen/fix_eval_func_reflection
--
This message was sent by Atlassian JIRA
(v6.1#6144)