hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stathis Fotiadis (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-14206) CASE boolean output is NULL when SUM condition statement returns NULL
Date Tue, 12 Jul 2016 08:07:21 GMT

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

Stathis Fotiadis updated HIVE-14206:
------------------------------------
    Description: 
This query 

{code:sql}
select
case when 1=sum(1) then true else false end) bool_true,
(case when 1=sum(0) then true else false end) bool_false,
(case when 1=(1+null) then true else false end) bool_null,
(case when 1=sum(1+null) then true else false end) bool_null_sum,
(case when 1=sum(1) then 'true' else 'false' end) string_true,
(case when 1=sum(0) then 'true' else 'false' end) string_false,
(case when 1=(1+null) then 'true' else 'false' end) string_null,
(case when 1=sum(1+null) then 'true' else 'false' end) string_null_sum
{code}

results to


bool_true bool_false   bool_null    bool_null_sum    string_true     string_false    string_null
  string_null_sum
true	        false	    false          NULL                   true                false   
          false            false

First of all the is the inconsistency between (1+null) and SUM(1+null) and secondly the inconsistency
between using boolean and string output

  was:
This query 

{code:sql}
select
case when 1=sum(1) then true else false end) bool_true,
(case when 1=sum(0) then true else false end) bool_false,
(case when 1=(1+null) then true else false end) bool_null,
(case when 1=sum(1+null) then true else false end) bool_null_sum,
(case when 1=sum(1) then 'true' else 'false' end) string_true,
(case when 1=sum(0) then 'true' else 'false' end) string_false,
(case when 1=(1+null) then 'true' else 'false' end) string_null,
(case when 1=sum(1+null) then 'true' else 'false' end) string_null_sum
{/code}

results to


bool_true bool_false   bool_null    bool_null_sum    string_true     string_false    string_null
  string_null_sum
true	        false	    false          NULL                   true                false   
          false            false

First of all the is the inconsistency between (1+null) and SUM(1+null) and secondly the inconsistency
between using boolean and string output


> CASE boolean output is NULL when SUM condition statement returns NULL
> ---------------------------------------------------------------------
>
>                 Key: HIVE-14206
>                 URL: https://issues.apache.org/jira/browse/HIVE-14206
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Stathis Fotiadis
>            Priority: Critical
>
> This query 
> {code:sql}
> select
> case when 1=sum(1) then true else false end) bool_true,
> (case when 1=sum(0) then true else false end) bool_false,
> (case when 1=(1+null) then true else false end) bool_null,
> (case when 1=sum(1+null) then true else false end) bool_null_sum,
> (case when 1=sum(1) then 'true' else 'false' end) string_true,
> (case when 1=sum(0) then 'true' else 'false' end) string_false,
> (case when 1=(1+null) then 'true' else 'false' end) string_null,
> (case when 1=sum(1+null) then 'true' else 'false' end) string_null_sum
> {code}
> results to
> bool_true bool_false   bool_null    bool_null_sum    string_true     string_false   
string_null   string_null_sum
> true	        false	    false          NULL                   true                false
             false            false
> First of all the is the inconsistency between (1+null) and SUM(1+null) and secondly the
inconsistency between using boolean and string output



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message