Grokbase Groups Pig dev February 2010
FAQ
cast ends up with NULL value
----------------------------

Key: PIG-1222
URL: https://issues.apache.org/jira/browse/PIG-1222
Project: Pig
Issue Type: Bug
Reporter: Ying He


I want to generate data with bags, so I did this,

take a simple text file b.txt

100 apple
200 orange
300 pear
400 apple

then run query:

a = load 'b.txt' as (id, f);
b = group a by id;
store b into 'g' using BinStorage();

then run another query to load data generated from previous step.

a = load 'g/part*' using BinStorage() as (id, d:bag{t:(v, s)});
b = foreach a generate (double)id, flatten(d);
dump b;

then I got the following result:

(,100,apple)
(,100,apple)
(,200,orange)
(,200,apple)
(,300,strawberry)
(,300,pear)
(,400,pear)

the value for id is gone. If there is no cast, then the result is correct.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

  • Alan Gates (JIRA) at Sep 21, 2010 at 7:39 pm
    [ https://issues.apache.org/jira/browse/PIG-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Alan Gates updated PIG-1222:
    ----------------------------

    Assignee: Alan Gates
    Fix Version/s: 0.9.0
    Priority: Minor (was: Major)
    cast ends up with NULL value
    ----------------------------

    Key: PIG-1222
    URL: https://issues.apache.org/jira/browse/PIG-1222
    Project: Pig
    Issue Type: Bug
    Reporter: Ying He
    Assignee: Alan Gates
    Priority: Minor
    Fix For: 0.9.0


    I want to generate data with bags, so I did this,
    take a simple text file b.txt
    100 apple
    200 orange
    300 pear
    400 apple
    then run query:
    a = load 'b.txt' as (id, f);
    b = group a by id;
    store b into 'g' using BinStorage();
    then run another query to load data generated from previous step.
    a = load 'g/part*' using BinStorage() as (id, d:bag{t:(v, s)});
    b = foreach a generate (double)id, flatten(d);
    dump b;
    then I got the following result:
    (,100,apple)
    (,100,apple)
    (,200,orange)
    (,200,apple)
    (,300,strawberry)
    (,300,pear)
    (,400,pear)
    the value for id is gone. If there is no cast, then the result is correct.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriespig, hadoop
postedFeb 4, '10 at 7:51p
activeSep 21, '10 at 7:39p
posts2
users1
websitepig.apache.org

1 user in discussion

Alan Gates (JIRA): 2 posts

People

Translate

site design / logo © 2023 Grokbase