FAQ
AND and OR do not give right results with nulls
-----------------------------------------------

Key: PIG-434
URL: https://issues.apache.org/jira/browse/PIG-434
Project: Pig
Issue Type: Bug
Affects Versions: types_branch
Reporter: Pradeep Kamath
Fix For: types_branch


Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)

{code}

// truth table for AND
// t = true, n = null, f = false
// AND t n f
// t t n f
// n n n f
// f f f f


// truth table for OR
// t = true, n = null, f = false
// OR t n f
// t t t t
// n t n n
// f t n f

{code}

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

Search Discussions

  • Pradeep Kamath (JIRA) at Sep 16, 2008 at 9:46 pm
    [ https://issues.apache.org/jira/browse/PIG-434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Pradeep Kamath updated PIG-434:
    -------------------------------

    Description:
    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)

    {code}

    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f


    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f

    {code}

    was:
    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)

    {code}

    // truth table for AND
    // t = true, n = null, f = false
    // AND t n f
    // t t n f
    // n n n f
    // f f f f


    // truth table for OR
    // t = true, n = null, f = false
    // OR t n f
    // t t t t
    // n t n n
    // f t n f

    {code}

    AND and OR do not give right results with nulls
    -----------------------------------------------

    Key: PIG-434
    URL: https://issues.apache.org/jira/browse/PIG-434
    Project: Pig
    Issue Type: Bug
    Affects Versions: types_branch
    Reporter: Pradeep Kamath
    Fix For: types_branch


    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)
    {code}
    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f
    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f
    {code}
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Pradeep Kamath (JIRA) at Sep 16, 2008 at 9:46 pm
    [ https://issues.apache.org/jira/browse/PIG-434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Pradeep Kamath updated PIG-434:
    -------------------------------

    Description:
    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)

    {noformat}

    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f


    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f

    {noformat}

    was:
    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)

    {code}

    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f


    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f

    {code}

    AND and OR do not give right results with nulls
    -----------------------------------------------

    Key: PIG-434
    URL: https://issues.apache.org/jira/browse/PIG-434
    Project: Pig
    Issue Type: Bug
    Affects Versions: types_branch
    Reporter: Pradeep Kamath
    Fix For: types_branch


    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)
    {noformat}
    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f
    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f
    {noformat}
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Pradeep Kamath (JIRA) at Sep 16, 2008 at 10:36 pm
    [ https://issues.apache.org/jira/browse/PIG-434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Pradeep Kamath updated PIG-434:
    -------------------------------

    Patch Info: [Patch Available]
    AND and OR do not give right results with nulls
    -----------------------------------------------

    Key: PIG-434
    URL: https://issues.apache.org/jira/browse/PIG-434
    Project: Pig
    Issue Type: Bug
    Affects Versions: types_branch
    Reporter: Pradeep Kamath
    Fix For: types_branch

    Attachments: PIG-434.patch


    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)
    {noformat}
    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f
    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f
    {noformat}
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Pradeep Kamath (JIRA) at Sep 16, 2008 at 10:36 pm
    [ https://issues.apache.org/jira/browse/PIG-434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Pradeep Kamath updated PIG-434:
    -------------------------------

    Attachment: PIG-434.patch

    Attached patch to fix the issue
    AND and OR do not give right results with nulls
    -----------------------------------------------

    Key: PIG-434
    URL: https://issues.apache.org/jira/browse/PIG-434
    Project: Pig
    Issue Type: Bug
    Affects Versions: types_branch
    Reporter: Pradeep Kamath
    Fix For: types_branch

    Attachments: PIG-434.patch


    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)
    {noformat}
    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f
    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f
    {noformat}
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Olga Natkovich (JIRA) at Sep 17, 2008 at 3:28 pm
    [ https://issues.apache.org/jira/browse/PIG-434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Olga Natkovich resolved PIG-434.
    --------------------------------

    Resolution: Fixed

    patch committed, thanks, pradeep
    AND and OR do not give right results with nulls
    -----------------------------------------------

    Key: PIG-434
    URL: https://issues.apache.org/jira/browse/PIG-434
    Project: Pig
    Issue Type: Bug
    Affects Versions: types_branch
    Reporter: Pradeep Kamath
    Fix For: types_branch

    Attachments: PIG-434.patch


    Here are the truth tables for AND and OR - currently we do not short circuit and return a null if either operand is null (for both AND and OR)
    {noformat}
    truth table for AND
    t = true, n = null, f = false
    AND t n f
    t t n f
    n n n f
    f f f f
    truth table for OR
    t = true, n = null, f = false
    OR t n f
    t t t t
    n t n n
    f t n f
    {noformat}
    --
    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
postedSep 16, '08 at 9:42p
activeSep 17, '08 at 3:28p
posts6
users1
websitepig.apache.org

1 user in discussion

Olga Natkovich (JIRA): 6 posts

People

Translate

site design / logo © 2022 Grokbase