Grokbase Groups Pig dev April 2011
FAQ
complex type casting should return null on casting failure
-----------------------------------------------------------

Key: PIG-1989
URL: https://issues.apache.org/jira/browse/PIG-1989
Project: Pig
Issue Type: Bug
Affects Versions: 0.9.0
Reporter: Thejas M Nair
Fix For: 0.9.0


When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
It should return null instead. That is consistent with the behavior when casting to other basic types.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Search Discussions

  • Daniel Dai (JIRA) at Apr 22, 2011 at 8:10 pm
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Daniel Dai reassigned PIG-1989:
    -------------------------------

    Assignee: Daniel Dai
    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Daniel Dai (JIRA) at Apr 26, 2011 at 12:00 am
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025011#comment-13025011 ]

    Daniel Dai commented on PIG-1989:
    ---------------------------------

    I tried some test cases, seems currently we set the inner fields which cannot cast to null:

    {code}
    input:
    (a,b,3)

    a = load '1.txt' as (t:tuple(i0, i1, i2));
    b = foreach a generate (tuple(int,int,int))t;

    We get: ((,,3))
    {code}

    {code}
    input:
    {(a,1)}

    a = load '1.txt' as (a0:bag{t:tuple(i0,i1)});
    b = foreach a generate (bag{tuple(int,int)})a0;

    We get: ({(,1)})
    {code}

    {code}
    input:
    [key#value]

    a = load '1.txt' as (m:map[]);
    b = foreach a generate (map[int])m;
    dump b;

    We get: ([key#])
    {code}

    Sounds Ok to me. Thejas, do you see something else, or you feel this is not proper?
    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Thejas M Nair (JIRA) at Apr 26, 2011 at 1:04 am
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025018#comment-13025018 ]

    Thejas M Nair commented on PIG-1989:
    ------------------------------------

    The problem is seen in this case -
    {code}
    input:
    (a,b,3)

    a = load 'inp.txt' as (t:tuple(i0, i1, i2));
    b = foreach a generate (tuple(tuple(int)))$0;
    dump b;


    We get: ((,b,3)), instead of ()
    {code}
    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Daniel Dai (JIRA) at Apr 26, 2011 at 10:17 pm
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Daniel Dai updated PIG-1989:
    ----------------------------

    Attachment: PIG-1989-1.patch

    This happens when the size of tuple inner schema does not match the data. Attach PIG-1989-1.patch.
    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0

    Attachments: PIG-1989-1.patch


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Daniel Dai (JIRA) at Apr 28, 2011 at 8:55 pm
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Daniel Dai updated PIG-1989:
    ----------------------------

    Attachment: PIG-1989-2.patch

    PIG-1989-2.patch include suggestions from Thejas, and address findbug warnings.
    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0

    Attachments: PIG-1989-1.patch, PIG-1989-2.patch


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • jiraposter@reviews.apache.org (JIRA) at Apr 28, 2011 at 8:59 pm
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026673#comment-13026673 ]

    [email protected] commented on PIG-1989:
    ----------------------------------------------------


    -----------------------------------------------------------
    This is an automatically generated e-mail. To reply, visit:
    https://reviews.apache.org/r/673/
    -----------------------------------------------------------

    Review request for pig and thejas.


    Summary
    -------

    See PIG-1989


    This addresses bug PIG-1989.
    https://issues.apache.org/jira/browse/PIG-1989


    Diffs
    -----

    http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java 1097304
    http://svn.apache.org/repos/asf/pig/trunk/test/org/apache/pig/test/TestPOCast.java 1097304

    Diff: https://reviews.apache.org/r/673/diff


    Testing
    -------

    Test-patch:
    [exec] +1 overall.
    [exec]
    [exec] +1 @author. The patch does not contain any @author tags.
    [exec]
    [exec] +1 tests included. The patch appears to include 3 new or modified tests.
    [exec]
    [exec] +1 javadoc. The javadoc tool did not generate any warning messages.
    [exec]
    [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.
    [exec]
    [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.
    [exec]
    [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.

    Unit test:
    all pass


    Thanks,

    Daniel


    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0

    Attachments: PIG-1989-1.patch, PIG-1989-2.patch


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • jiraposter@reviews.apache.org (JIRA) at Apr 28, 2011 at 10:10 pm
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026727#comment-13026727 ]

    [email protected] commented on PIG-1989:
    ----------------------------------------------------


    -----------------------------------------------------------
    This is an automatically generated e-mail. To reply, visit:
    https://reviews.apache.org/r/673/#review606
    -----------------------------------------------------------

    Ship it!


    +1

    - thejas


    On 2011-04-28 20:56:30, Daniel Dai wrote:
    bq.
    bq. -----------------------------------------------------------
    bq. This is an automatically generated e-mail. To reply, visit:
    bq. https://reviews.apache.org/r/673/
    bq. -----------------------------------------------------------
    bq.
    bq. (Updated 2011-04-28 20:56:30)
    bq.
    bq.
    bq. Review request for pig and thejas.
    bq.
    bq.
    bq. Summary
    bq. -------
    bq.
    bq. See PIG-1989
    bq.
    bq.
    bq. This addresses bug PIG-1989.
    bq. https://issues.apache.org/jira/browse/PIG-1989
    bq.
    bq.
    bq. Diffs
    bq. -----
    bq.
    bq. http://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POCast.java 1097304
    bq. http://svn.apache.org/repos/asf/pig/trunk/test/org/apache/pig/test/TestPOCast.java 1097304
    bq.
    bq. Diff: https://reviews.apache.org/r/673/diff
    bq.
    bq.
    bq. Testing
    bq. -------
    bq.
    bq. Test-patch:
    bq. [exec] +1 overall.
    bq. [exec]
    bq. [exec] +1 @author. The patch does not contain any @author tags.
    bq. [exec]
    bq. [exec] +1 tests included. The patch appears to include 3 new or modified tests.
    bq. [exec]
    bq. [exec] +1 javadoc. The javadoc tool did not generate any warning messages.
    bq. [exec]
    bq. [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings.
    bq. [exec]
    bq. [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings.
    bq. [exec]
    bq. [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings.
    bq.
    bq. Unit test:
    bq. all pass
    bq.
    bq.
    bq. Thanks,
    bq.
    bq. Daniel
    bq.
    bq.


    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0

    Attachments: PIG-1989-1.patch, PIG-1989-2.patch


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira
  • Daniel Dai (JIRA) at Apr 29, 2011 at 12:44 am
    [ https://issues.apache.org/jira/browse/PIG-1989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Daniel Dai resolved PIG-1989.
    -----------------------------

    Resolution: Fixed
    Hadoop Flags: [Reviewed]

    Patch committed to both trunk and 0.9 branch.
    complex type casting should return null on casting failure
    -----------------------------------------------------------

    Key: PIG-1989
    URL: https://issues.apache.org/jira/browse/PIG-1989
    Project: Pig
    Issue Type: Bug
    Affects Versions: 0.9.0
    Reporter: Thejas M Nair
    Assignee: Daniel Dai
    Fix For: 0.9.0

    Attachments: PIG-1989-1.patch, PIG-1989-2.patch


    When casting fails for complex objects, pig is currently returning un-casted object if the cast fails.
    It should return null instead. That is consistent with the behavior when casting to other basic types.
    --
    This message is automatically generated by JIRA.
    For more information on JIRA, see: http://www.atlassian.com/software/jira

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriespig, hadoop
postedApr 11, '11 at 6:14p
activeApr 29, '11 at 12:44a
posts9
users1
websitepig.apache.org

1 user in discussion

Daniel Dai (JIRA): 9 posts

People

Translate

site design / logo © 2023 Grokbase