You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Eyal Allweil (JIRA)" <ji...@apache.org> on 2016/02/12 22:48:18 UTC

[jira] [Updated] (PIG-4808) PluckTuple overwrites regex if used more than once in the same script

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

Eyal Allweil updated PIG-4808:
------------------------------
    Attachment: PIG-4808.patch

This patch fixes the bug by removing the static modifier, and adds a new test to check for this case. I also changed the order of the main conditional in the exec method, because checking the boolean (which is fast) should come before the pattern matching (which is slower).

> PluckTuple overwrites regex if used more than once in the same script
> ---------------------------------------------------------------------
>
>                 Key: PIG-4808
>                 URL: https://issues.apache.org/jira/browse/PIG-4808
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.15.0
>            Reporter: Eyal Allweil
>            Assignee: Eyal Allweil
>         Attachments: PIG-4808.patch
>
>
> If you define two PluckTuples with different regexes, and use them together, they will overwrite the regex field of one another's (this will not affect cases where non-regex prefixes are used).
> Example (from testOutput in TestPluckTuple.java, modified)
> a = load 'a' using mock.Storage();
> b = load 'b' using mock.Storage();
> c = join a by x, b by x;
> define pluck1 PluckTuple('a::.*');
> define pluck2 PluckTuple('b::.*');
> d = foreach c generate pluck1(*) AS pluck1, pluck2(*) AS pluck2;
> Expected:
> ((1,hey,2),(1,sasf,5))
> ((2,woah,3),(2,woah,6))
> Actual:
> ((1,sasf,5),(1,sasf,5))
> ((2,woah,6),(2,woah,6))



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)