[ 
https://issues.apache.org/jira/browse/HIVE-17332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135051#comment-16135051
 ] 

Zoltan Haindrich edited comment on HIVE-17332 at 8/21/17 11:52 AM:
-------------------------------------------------------------------

Hello [~luky],

I was not able to reproduce the issue on the current master...it might be 
possible that its not anymore present...
I've just guessed the column types..they might be more relevant....and my guess 
is that the problem might be sensitive to some null value in some column - does 
the snapshot column contains null values?
Could you check the following case:

{code}
create table EXM_BASE_DATA (key string) partitioned by (snapshot int) stored as 
orc;
insert into EXM_BASE_DATA partition(snapshot=1) values ('asd') ;
insert into EXM_BASE_DATA partition(snapshot=2) values (null) ;
set hive.auto.convert.join = false;
select count(*) from
        (select * from EXM_BASE_DATA join (select max(snapshot) max_snapshot 
from EXM_BASE_DATA) s0 on (snapshot = max_snapshot)) t;
{code}


or this more sophisticated one:

{code}
set hive.exec.dynamic.partition.mode=nonstrict;

create table t0 (key string,snapshot int);
insert into t0 values (1,'asd');
insert into t0 values (null,'asd2');
insert into t0 values (2,null);
insert into t0 values (null,null);


create table EXM_BASE_DATA (key string) partitioned by (snapshot int) stored as 
orc;

from t0
insert into EXM_BASE_DATA partition(snapshot) select key,snapshot;

insert into EXM_BASE_DATA partition(snapshot=1) values ('asdx') ;
insert into EXM_BASE_DATA partition(snapshot=1) values ('asd') ;
insert into EXM_BASE_DATA partition(snapshot=2) values (null) ;

set hive.auto.convert.join = false;

select count(*) from
        (select * from EXM_BASE_DATA join (select max(snapshot) max_snapshot 
from EXM_BASE_DATA) s0 on (snapshot = max_snapshot)) t;

{code}


was (Author: kgyrtkirk):
Hello [~luky],

I was not able to reproduce the issue on the current master...it might be 
possible that its not anymore present...
I've just guessed the column types..they might be more relevant....and my guess 
is that the problem might be sensitive to some null value in some column - does 
the snapshot column contains null values?
Could you check the following case:

{code}
create table EXM_BASE_DATA (key string) partitioned by (snapshot int) stored as 
orc;
insert into EXM_BASE_DATA partition(snapshot=1) values ('asd') ;
insert into EXM_BASE_DATA partition(snapshot=2) values (null) ;
set hive.auto.convert.join = false;
select count(*) from
        (select * from EXM_BASE_DATA join (select max(snapshot) max_snapshot 
from EXM_BASE_DATA) s0 on (snapshot = max_snapshot)) t;
{code}


> NullPointer exception when processing query
> -------------------------------------------
>
>                 Key: HIVE-17332
>                 URL: https://issues.apache.org/jira/browse/HIVE-17332
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Lukas Waldmann
>
> Hive query:
> {code}
> select count(*) from (select * from EXM_BASE_DATA, (select max(snapshot) 
> max_snapshot from EXM_BASE_DATA) s0 where snapshot == max_snapshot) t;
> {code}
> finish with NullPointer exception
> while 
> {code}
> select * from EXM_BASE_DATA, (select max(snapshot) max_snapshot from 
> EXM_BASE_DATA) s0 where snapshot == max_snapshot
> {code}
> is executed without error



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to