Namit Jain created HIVE-3909:
--------------------------------

             Summary: Wrong data due to HIVE-2820
                 Key: HIVE-3909
                 URL: https://issues.apache.org/jira/browse/HIVE-3909
             Project: Hive
          Issue Type: Bug
            Reporter: Namit Jain


Consider the query:

~/hive/hive1$ more ql/src/test/queries/clientpositive/join_reorder4.q
CREATE TABLE T1(key1 STRING, val1 STRING) STORED AS TEXTFILE;
CREATE TABLE T2(key2 STRING, val2 STRING) STORED AS TEXTFILE;
CREATE TABLE T3(key3 STRING, val3 STRING) STORED AS TEXTFILE;

LOAD DATA LOCAL INPATH '../data/files/T1.txt' INTO TABLE T1;
LOAD DATA LOCAL INPATH '../data/files/T2.txt' INTO TABLE T2;
LOAD DATA LOCAL INPATH '../data/files/T3.txt' INTO TABLE T3;

set hive.auto.convert.join=true;

explain select /*+ STREAMTABLE(a) */ a.*, b.*, c.* from T1 a join T2 b on 
a.key1=b.key2 join T3 c on a.key1=c.key3;
select /*+ STREAMTABLE(a) */ a.*, b.*, c.* from T1 a join T2 b on a.key1=b.key2 
join T3 c on a.key1=c.key3;

explain select /*+ STREAMTABLE(b) */ a.*, b.*, c.* from T1 a join T2 b on 
a.key1=b.key2 join T3 c on a.key1=c.key3;
select /*+ STREAMTABLE(b) */ a.*, b.*, c.* from T1 a join T2 b on a.key1=b.key2 
join T3 c on a.key1=c.key3;

explain select /*+ STREAMTABLE(c) */ a.*, b.*, c.* from T1 a join T2 b on 
a.key1=b.key2 join T3 c on a.key1=c.key3;
select /*+ STREAMTABLE(c) */ a.*, b.*, c.* from T1 a join T2 b on a.key1=b.key2 
join T3 c on a.key1=c.key3;



select /*+ STREAMTABLE(b) */ a.*, b.*, c.* from T1 a join T2 b on a.key1=b.key2 
join T3 c on a.key1=c.key3;

returns:
2       12      2       12      2       22

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to