hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "balaswamy vaddeman (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-13977) nvl funtion not working after left outer join
Date Fri, 10 Jun 2016 05:46:20 GMT

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

balaswamy vaddeman updated HIVE-13977:
--------------------------------------
    Description: 
Recreating problem.

1).Create table with sample data.

create table tabletest (n bigint, t string); 
insert into tabletest values (1, 'one'); 
insert into tabletest values(2, 'two'); 

2) Run leftouter join query on single table.

select a.n as leftHandN 
, b.n as rightHandN 
, b.t as rightHandT 
, nvl(b.t,"empty") as rightHandTnvl -- Expected empty --> received empty
, nvl(b.n,-1) as rightHandNnvl -- Expected -1 --> received 1 
from 
(
select *
from tabletest 
where n=1
) a
left outer join
(
select *
from tabletest 
where 1=2
) b
on a.n = b.n;

nvl(b.n,-1) should return -1 but returns 1.

I have found b.n always returning a.n value.if a.n is 1 ,b.n is returning 1 and if it is 2,same
2 will be returned.



  was:
Recreating problem.

1).Create table with sample data.

create table tabletest (n bigint, t string); 
insert into tabletest values (1, 'one'); 
insert into tabletest values(2, 'two'); 

2) Run leftouter join query on single table.

select a.n as leftHandN 
, b.n as rightHandN 
, b.t as rightHandT 
, nvl(b.t,"empty") as rightHandTnvl -- Expected empty --> received empty
, nvl(b.n,-1) as rightHandNnvl -- Expected -1 --> received 1 
from 
(
select *
from tabletest 
where n=1
) a
left outer join
(
select *
from tabletest 
where 1=2
) 
on a.n = b.n;

nvl(b.n,-1) should return -1 but returns 1.

I have found b.n always returning a.n value.if a.n is 1 ,b.n is returning 1 and if it is 2,same
2 will be returned.




> nvl funtion not working after left outer join 
> ----------------------------------------------
>
>                 Key: HIVE-13977
>                 URL: https://issues.apache.org/jira/browse/HIVE-13977
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 1.2.1
>            Reporter: balaswamy vaddeman
>
> Recreating problem.
> 1).Create table with sample data.
> create table tabletest (n bigint, t string); 
> insert into tabletest values (1, 'one'); 
> insert into tabletest values(2, 'two'); 
> 2) Run leftouter join query on single table.
> select a.n as leftHandN 
> , b.n as rightHandN 
> , b.t as rightHandT 
> , nvl(b.t,"empty") as rightHandTnvl -- Expected empty --> received empty
> , nvl(b.n,-1) as rightHandNnvl -- Expected -1 --> received 1 
> from 
> (
> select *
> from tabletest 
> where n=1
> ) a
> left outer join
> (
> select *
> from tabletest 
> where 1=2
> ) b
> on a.n = b.n;
> nvl(b.n,-1) should return -1 but returns 1.
> I have found b.n always returning a.n value.if a.n is 1 ,b.n is returning 1 and if it
is 2,same 2 will be returned.



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

Mime
View raw message