You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2014/09/08 07:00:33 UTC

[jira] [Updated] (PIG-3870) STRSPLITTOBAG UDF

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

Daniel Dai updated PIG-3870:
----------------------------
    Assignee: karan kumar

> STRSPLITTOBAG UDF
> -----------------
>
>                 Key: PIG-3870
>                 URL: https://issues.apache.org/jira/browse/PIG-3870
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.12.0
>            Reporter: Praveenesh Kumar
>            Assignee: karan kumar
>             Fix For: 0.12.0
>
>
> I had a scenario, which required me to change the STRSPLIT code. The scenario was as follows:
> I have a data like:
> 1       A|1|1   some
> 2       B|2|2   data
> 3       C|3|3   hadoop
> Need output like this :
> 1    A    some
> 1    1    some
> 1    1    some
> 2    B    data
> 2    2     data
> 2    2     data
> 3    C    hadoop
> 3    3    hadoop
> 3    3    hadoop
> I was trying to use STRSPLIT($1,'\\\|') which was returning a tuple, If I do flatten on it, it converts the data into columns.
> If we return a bag of tuples, we can easily use flatten() to convert it into rows, plus can also convert that into Tuple using TOTUPLE() UDF (if someone just want to use it as tuple)
> After the suggestion from [~daijy], I am creating a JIRA ticket to create a new UDF STRSPLITTOBAG, which will return a bag of tuples as suggested above.



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