You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Laszlo Bodor (JIRA)" <ji...@apache.org> on 2018/05/29 22:14:00 UTC

[jira] [Updated] (HIVE-16505) Support "unknown" boolean truth value

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

Laszlo Bodor updated HIVE-16505:
--------------------------------
    Description: 
according to the standard, boolean truth value might be: {{TRUE|FALSE|UNKNOWN}}.

similar queries to the following should be supported:
{code:java}
select 1 where null is unknown;
select 1 where (select cast(null as boolean) ) is unknown;
{code}
"unknown" behaves similarily to null. {{(null=null) is null}}

 

"All boolean values and SQL truth values are comparable and all are assignable to a site of type boolean. The value True is greater than the value False, and any comparison involving the null value or an Unknown truth value will return an Unknown result. The values True and False may be assigned to any site having a boolean data type; assignment of Unknown, or the null value, is subject to the nullability characteristic of the target."

 

Truth table for the AND boolean operator
AND True False Unknown
True True False Unknown
False False False False
Unknown Unknown False Unknown

Truth table for the OR boolean operator
OR True False Unknown
True True True True
False True False Unknown
Unknown True Unknown Unknown

Truth table for the IS boolean operator
IS TRUE FALSE UNKNOWN
True True False False
False False True False
Unknown False False True

 

  was:
according to the standard, boolean truth value might be: {{TRUE|FALSE|UNKNOWN}}.

similar queries to the following should be supported:
{code}
select 1 where null is unknown;
select 1 where (select cast(null as boolean) ) is unknown;
{code}

"unknown" behaves similarily to null. {{(null=null) is null}}


> Support "unknown" boolean truth value
> -------------------------------------
>
>                 Key: HIVE-16505
>                 URL: https://issues.apache.org/jira/browse/HIVE-16505
>             Project: Hive
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Zoltan Haindrich
>            Assignee: Laszlo Bodor
>            Priority: Major
>
> according to the standard, boolean truth value might be: {{TRUE|FALSE|UNKNOWN}}.
> similar queries to the following should be supported:
> {code:java}
> select 1 where null is unknown;
> select 1 where (select cast(null as boolean) ) is unknown;
> {code}
> "unknown" behaves similarily to null. {{(null=null) is null}}
>  
> "All boolean values and SQL truth values are comparable and all are assignable to a site of type boolean. The value True is greater than the value False, and any comparison involving the null value or an Unknown truth value will return an Unknown result. The values True and False may be assigned to any site having a boolean data type; assignment of Unknown, or the null value, is subject to the nullability characteristic of the target."
>  
> Truth table for the AND boolean operator
> AND True False Unknown
> True True False Unknown
> False False False False
> Unknown Unknown False Unknown
> Truth table for the OR boolean operator
> OR True False Unknown
> True True True True
> False True False Unknown
> Unknown True Unknown Unknown
> Truth table for the IS boolean operator
> IS TRUE FALSE UNKNOWN
> True True False False
> False False True False
> Unknown False False True
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)