tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyunsik Choi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TAJO-182) Comparison of primitive values including null value should return NULL.
Date Thu, 19 Dec 2013 05:31:07 GMT

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

Hyunsik Choi updated TAJO-182:
------------------------------

    Attachment: TAJO-182.patch

Prafulla,

I've attached the patch. If you can afford to review this patch, could you do that? This patch
also includes the fix of NULL literal. I added the following unit tests.

{code}
    testSimpleEval("select null is null", new String[] {"t"});
    testSimpleEval("select null is not null", new String[] {"f"});

    testSimpleEval("select (1::int2 > null) is null", new String[] {"t"});
    testSimpleEval("select (1::int2 < null) is null", new String[] {"t"});
    testSimpleEval("select (1::int2 >= null) is null", new String[] {"t"});
    testSimpleEval("select (1::int2 <= null) is null", new String[] {"t"});
    testSimpleEval("select (1::int2 <> null) is null", new String[] {"t"});

    testSimpleEval("select (1::int4 > null) is null", new String[] {"t"});
    testSimpleEval("select (1::int4 < null) is null", new String[] {"t"});
    testSimpleEval("select (1::int4 >= null) is null", new String[] {"t"});
    testSimpleEval("select (1::int4 <= null) is null", new String[] {"t"});
    testSimpleEval("select (1::int4 <> null) is null", new String[] {"t"});

    testSimpleEval("select (1::int8 > null) is null", new String[] {"t"});
    testSimpleEval("select (1::int8 < null) is null", new String[] {"t"});
    testSimpleEval("select (1::int8 >= null) is null", new String[] {"t"});
    testSimpleEval("select (1::int8 <= null) is null", new String[] {"t"});
    testSimpleEval("select (1::int8 <> null) is null", new String[] {"t"});

    testSimpleEval("select (1::float > null) is null", new String[] {"t"});
    testSimpleEval("select (1::float < null) is null", new String[] {"t"});
    testSimpleEval("select (1::float >= null) is null", new String[] {"t"});
    testSimpleEval("select (1::float <= null) is null", new String[] {"t"});
    testSimpleEval("select (1::float <> null) is null", new String[] {"t"});

    testSimpleEval("select (1::float8 > null) is null", new String[] {"t"});
    testSimpleEval("select (1::float8 < null) is null", new String[] {"t"});
    testSimpleEval("select (1::float8 >= null) is null", new String[] {"t"});
    testSimpleEval("select (1::float8 <= null) is null", new String[] {"t"});
    testSimpleEval("select (1::float8 <> null) is null", new String[] {"t"});

    testSimpleEval("select ('abc' > null) is null", new String[] {"t"});
    testSimpleEval("select ('abc' < null) is null", new String[] {"t"});
    testSimpleEval("select ('abc' >= null) is null", new String[] {"t"});
    testSimpleEval("select ('abc' <= null) is null", new String[] {"t"});
    testSimpleEval("select ('abc' <> null) is null", new String[] {"t"});

    testSimpleEval("select ('1980-04-01'::date > null) is null", new String[] {"t"});
    testSimpleEval("select ('1980-04-01'::date < null) is null", new String[] {"t"});
    testSimpleEval("select ('1980-04-01'::date >= null) is null", new String[] {"t"});
    testSimpleEval("select ('1980-04-01'::date <= null) is null", new String[] {"t"});
    testSimpleEval("select ('1980-04-01'::date <> null) is null", new String[] {"t"});

    testSimpleEval("select ('09:08:50'::time > null) is null", new String[] {"t"});
    testSimpleEval("select ('09:08:50'::time < null) is null", new String[] {"t"});
    testSimpleEval("select ('09:08:50'::time >= null) is null", new String[] {"t"});
    testSimpleEval("select ('09:08:50'::time <= null) is null", new String[] {"t"});
    testSimpleEval("select ('09:08:50'::time <> null) is null", new String[] {"t"});

    testSimpleEval("select ('1980-04-01 01:50:30'::timestamp > null) is null", new String[]
{"t"});
    testSimpleEval("select ('1980-04-01 01:50:30'::timestamp < null) is null", new String[]
{"t"});
    testSimpleEval("select ('1980-04-01 01:50:30'::timestamp >= null) is null", new String[]
{"t"});
    testSimpleEval("select ('1980-04-01 01:50:30'::timestamp <= null) is null", new String[]
{"t"});
    testSimpleEval("select ('1980-04-01 01:50:30'::timestamp <> null) is null", new
String[] {"t"});
{code}

> Comparison of primitive values including null value should return NULL.
> -----------------------------------------------------------------------
>
>                 Key: TAJO-182
>                 URL: https://issues.apache.org/jira/browse/TAJO-182
>             Project: Tajo
>          Issue Type: Bug
>          Components: planner/optimizer
>            Reporter: Hyunsik Choi
>            Assignee: Hyunsik Choi
>            Priority: Critical
>             Fix For: 0.8-incubating
>
>         Attachments: TAJO-182.patch
>
>
> -If some domain value is compared to Null value, the current implementation will cause
InvalidOperationException. Such cases should result in 'false'.-
> If some domain value is compared to Null value, the current implementation will cause
either InvalidOperationException or FALSE. Such cases should result in NULL.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message