Skip to content

Commit

Permalink
HIVE-8978: Fix test determinism issue for qfile: smb_mapjoin_1.q etc …
Browse files Browse the repository at this point in the history
…(Jimmy via Xuefu, reviewed by Brock)

git-svn-id: https://svn.apache.org/repos/asf/hive/trunk@1642127 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Xuefu Zhang committed Nov 27, 2014
1 parent 2e93b0c commit fc4a314
Show file tree
Hide file tree
Showing 22 changed files with 318 additions and 175 deletions.
2 changes: 2 additions & 0 deletions ql/src/test/queries/clientpositive/join_reorder.q
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ 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;

-- SORT_QUERY_RESULTS

EXPLAIN FROM T1 a JOIN src c ON c.key+1=a.key
SELECT a.key, a.val, c.key;

Expand Down
2 changes: 2 additions & 0 deletions ql/src/test/queries/clientpositive/outer_join_ppr.q
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set hive.optimize.ppd=true;

-- SORT_QUERY_RESULTS

EXPLAIN EXTENDED
FROM
src a
Expand Down
4 changes: 3 additions & 1 deletion ql/src/test/queries/clientpositive/smb_mapjoin_1.q
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ load data local inpath '../../data/files/smbbucket_3.rc' overwrite into table sm
set hive.optimize.bucketmapjoin = true;
set hive.optimize.bucketmapjoin.sortedmerge = true;
set hive.input.format = org.apache.hadoop.hive.ql.io.BucketizedHiveInputFormat;


-- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key;
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key;
Expand Down
4 changes: 3 additions & 1 deletion ql/src/test/queries/clientpositive/smb_mapjoin_2.q
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ load data local inpath '../../data/files/smbbucket_3.rc' overwrite into table sm
set hive.optimize.bucketmapjoin = true;
set hive.optimize.bucketmapjoin.sortedmerge = true;
set hive.input.format = org.apache.hadoop.hive.ql.io.BucketizedHiveInputFormat;


-- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_3 b on a.key = b.key;
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_3 b on a.key = b.key;
Expand Down
4 changes: 3 additions & 1 deletion ql/src/test/queries/clientpositive/smb_mapjoin_4.q
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ load data local inpath '../../data/files/smbbucket_3.rc' overwrite into table sm
set hive.optimize.bucketmapjoin = true;
set hive.optimize.bucketmapjoin.sortedmerge = true;
set hive.input.format = org.apache.hadoop.hive.ql.io.BucketizedHiveInputFormat;


-- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a,b)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key join smb_bucket_3 c on b.key=c.key;
select /*+mapjoin(a,b)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key join smb_bucket_3 c on b.key=c.key;
Expand Down
4 changes: 3 additions & 1 deletion ql/src/test/queries/clientpositive/smb_mapjoin_5.q
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ load data local inpath '../../data/files/smbbucket_3.rc' overwrite into table sm
set hive.optimize.bucketmapjoin = true;
set hive.optimize.bucketmapjoin.sortedmerge = true;
set hive.input.format = org.apache.hadoop.hive.ql.io.BucketizedHiveInputFormat;


-- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a,c)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key join smb_bucket_3 c on b.key=c.key;
select /*+mapjoin(a,c)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key join smb_bucket_3 c on b.key=c.key;
Expand Down
1 change: 1 addition & 0 deletions ql/src/test/queries/clientpositive/smb_mapjoin_8.q
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set hive.enforce.bucketing = true;
set hive.enforce.sorting = true;
set hive.exec.reducers.max = 1;

-- SORT_QUERY_RESULTS

create table smb_bucket_input (key int, value string) stored as rcfile;
load data local inpath '../../data/files/smb_bucket_input.rc' into table smb_bucket_input;
Expand Down
2 changes: 2 additions & 0 deletions ql/src/test/queries/clientpositive/uniquejoin.q
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ 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;

-- SORT_QUERY_RESULTS

FROM UNIQUEJOIN PRESERVE T1 a (a.key), PRESERVE T2 b (b.key), PRESERVE T3 c (c.key)
SELECT a.key, b.key, c.key;

Expand Down
2 changes: 2 additions & 0 deletions ql/src/test/queries/clientpositive/vector_decimal_aggregate.q
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ CREATE TABLE decimal_vgby STORED AS ORC AS

SET hive.vectorized.execution.enabled=true;

-- SORT_QUERY_RESULTS

-- First only do simple aggregations that output primitives only
EXPLAIN SELECT cint,
COUNT(cdecimal1), MAX(cdecimal1), MIN(cdecimal1), SUM(cdecimal1),
Expand Down
4 changes: 4 additions & 0 deletions ql/src/test/queries/clientpositive/vectorization_13.q
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ WHERE (((cfloat < 3569)
AND ((ctimestamp2 != 12)
AND (ctinyint < 9763215.5639))))
GROUP BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
ORDER BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
LIMIT 40;

SELECT cboolean1,
Expand Down Expand Up @@ -62,6 +63,7 @@ WHERE (((cfloat < 3569)
AND ((ctimestamp2 != 12)
AND (ctinyint < 9763215.5639))))
GROUP BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
ORDER BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
LIMIT 40;

-- double compare timestamp
Expand Down Expand Up @@ -95,6 +97,7 @@ WHERE (((cfloat < 3569)
AND ((ctimestamp2 != -1.3359999999999999)
AND (ctinyint < 9763215.5639))))
GROUP BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
ORDER BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
LIMIT 40;

SELECT cboolean1,
Expand Down Expand Up @@ -126,5 +129,6 @@ WHERE (((cfloat < 3569)
AND ((ctimestamp2 != -1.3359999999999999)
AND (ctinyint < 9763215.5639))))
GROUP BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
ORDER BY cboolean1, ctinyint, ctimestamp1, cfloat, cstring1
LIMIT 40;

28 changes: 16 additions & 12 deletions ql/src/test/results/clientpositive/join_reorder.q.out
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/T3.txt' INTO TABLE T3
POSTHOOK: type: LOAD
#### A masked pattern was here ####
POSTHOOK: Output: default@t3
PREHOOK: query: EXPLAIN FROM T1 a JOIN src c ON c.key+1=a.key
PREHOOK: query: -- SORT_QUERY_RESULTS

EXPLAIN FROM T1 a JOIN src c ON c.key+1=a.key
SELECT a.key, a.val, c.key
PREHOOK: type: QUERY
POSTHOOK: query: EXPLAIN FROM T1 a JOIN src c ON c.key+1=a.key
POSTHOOK: query: -- SORT_QUERY_RESULTS

EXPLAIN FROM T1 a JOIN src c ON c.key+1=a.key
SELECT a.key, a.val, c.key
POSTHOOK: type: QUERY
STAGE DEPENDENCIES:
Expand Down Expand Up @@ -421,9 +425,9 @@ POSTHOOK: Input: default@t2
POSTHOOK: Input: default@t3
#### A masked pattern was here ####
2 2 12 12
7 NULL 17 17
NULL NULL NULL 14
NULL NULL NULL 16
7 NULL 17 17
PREHOOK: query: FROM T1 a
LEFT OUTER JOIN T2 b ON (b.key=a.key)
RIGHT OUTER JOIN T3 c ON (c.val = a.val)
Expand All @@ -443,9 +447,9 @@ POSTHOOK: Input: default@t2
POSTHOOK: Input: default@t3
#### A masked pattern was here ####
2 2 12 12
7 NULL 17 17
NULL NULL NULL 14
NULL NULL NULL 16
7 NULL 17 17
PREHOOK: query: EXPLAIN FROM UNIQUEJOIN
PRESERVE T1 a (a.key, a.val),
PRESERVE T2 b (b.key, b.val),
Expand Down Expand Up @@ -616,15 +620,15 @@ POSTHOOK: Input: default@t3
#### A masked pattern was here ####
1 NULL NULL
2 NULL 2
NULL 2 NULL
3 3 NULL
NULL 4 4
NULL 5 NULL
NULL NULL 6
7 NULL 7
8 8 NULL
8 8 NULL
8 NULL NULL
NULL 2 NULL
NULL 4 4
NULL 5 NULL
NULL NULL 6
PREHOOK: query: FROM UNIQUEJOIN
PRESERVE T1 a (a.key, a.val),
PRESERVE T2 b (b.key, b.val),
Expand All @@ -647,12 +651,12 @@ POSTHOOK: Input: default@t3
#### A masked pattern was here ####
1 NULL NULL
2 NULL 2
NULL 2 NULL
3 3 NULL
NULL 4 4
NULL 5 NULL
NULL NULL 6
7 NULL 7
8 8 NULL
8 8 NULL
8 NULL NULL
NULL 2 NULL
NULL 4 4
NULL 5 NULL
NULL NULL 6
Binary file modified ql/src/test/results/clientpositive/outer_join_ppr.q.out
Binary file not shown.
16 changes: 10 additions & 6 deletions ql/src/test/results/clientpositive/smb_mapjoin_1.q.out
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ POSTHOOK: query: load data local inpath '../../data/files/smbbucket_3.rc' overwr
POSTHOOK: type: LOAD
#### A masked pattern was here ####
POSTHOOK: Output: default@smb_bucket_3
PREHOOK: query: explain
PREHOOK: query: -- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key
PREHOOK: type: QUERY
POSTHOOK: query: explain
POSTHOOK: query: -- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_2 b on a.key = b.key
POSTHOOK: type: QUERY
STAGE DEPENDENCIES:
Expand Down Expand Up @@ -156,10 +160,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_2
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 NULL NULL
3 val_3 NULL NULL
4 val_4 NULL NULL
5 val_5 NULL NULL
10 val_10 NULL NULL
PREHOOK: query: explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a right outer join smb_bucket_2 b on a.key = b.key
PREHOOK: type: QUERY
Expand Down Expand Up @@ -271,10 +275,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_2
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 NULL NULL
3 val_3 NULL NULL
4 val_4 NULL NULL
5 val_5 NULL NULL
10 val_10 NULL NULL
NULL NULL 20 val_20
NULL NULL 23 val_23
NULL NULL 25 val_25
Expand Down Expand Up @@ -389,10 +393,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_2
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 NULL NULL
3 val_3 NULL NULL
4 val_4 NULL NULL
5 val_5 NULL NULL
10 val_10 NULL NULL
PREHOOK: query: explain
select /*+mapjoin(b)*/ * from smb_bucket_1 a right outer join smb_bucket_2 b on a.key = b.key
PREHOOK: type: QUERY
Expand Down Expand Up @@ -504,10 +508,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_2
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 NULL NULL
3 val_3 NULL NULL
4 val_4 NULL NULL
5 val_5 NULL NULL
10 val_10 NULL NULL
NULL NULL 20 val_20
NULL NULL 23 val_23
NULL NULL 25 val_25
Expand Down
24 changes: 14 additions & 10 deletions ql/src/test/results/clientpositive/smb_mapjoin_2.q.out
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ POSTHOOK: query: load data local inpath '../../data/files/smbbucket_3.rc' overwr
POSTHOOK: type: LOAD
#### A masked pattern was here ####
POSTHOOK: Output: default@smb_bucket_3
PREHOOK: query: explain
PREHOOK: query: -- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_3 b on a.key = b.key
PREHOOK: type: QUERY
POSTHOOK: query: explain
POSTHOOK: query: -- SORT_QUERY_RESULTS

explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a join smb_bucket_3 b on a.key = b.key
POSTHOOK: type: QUERY
STAGE DEPENDENCIES:
Expand Down Expand Up @@ -102,8 +106,8 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
4 val_4 4 val_4
10 val_10 10 val_10
4 val_4 4 val_4
PREHOOK: query: explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a left outer join smb_bucket_3 b on a.key = b.key
PREHOOK: type: QUERY
Expand Down Expand Up @@ -158,10 +162,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 10 val_10
3 val_3 NULL NULL
4 val_4 4 val_4
5 val_5 NULL NULL
10 val_10 10 val_10
PREHOOK: query: explain
select /*+mapjoin(a)*/ * from smb_bucket_1 a right outer join smb_bucket_3 b on a.key = b.key
PREHOOK: type: QUERY
Expand Down Expand Up @@ -215,8 +219,8 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
4 val_4 4 val_4
10 val_10 10 val_10
4 val_4 4 val_4
NULL NULL 17 val_17
NULL NULL 19 val_19
NULL NULL 20 val_20
Expand Down Expand Up @@ -275,10 +279,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 10 val_10
3 val_3 NULL NULL
4 val_4 4 val_4
5 val_5 NULL NULL
10 val_10 10 val_10
NULL NULL 17 val_17
NULL NULL 19 val_19
NULL NULL 20 val_20
Expand Down Expand Up @@ -339,8 +343,8 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
4 val_4 4 val_4
10 val_10 10 val_10
4 val_4 4 val_4
PREHOOK: query: explain
select /*+mapjoin(b)*/ * from smb_bucket_1 a left outer join smb_bucket_3 b on a.key = b.key
PREHOOK: type: QUERY
Expand Down Expand Up @@ -395,10 +399,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 10 val_10
3 val_3 NULL NULL
4 val_4 4 val_4
5 val_5 NULL NULL
10 val_10 10 val_10
PREHOOK: query: explain
select /*+mapjoin(b)*/ * from smb_bucket_1 a right outer join smb_bucket_3 b on a.key = b.key
PREHOOK: type: QUERY
Expand Down Expand Up @@ -452,8 +456,8 @@ POSTHOOK: type: QUERY
POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
4 val_4 4 val_4
10 val_10 10 val_10
4 val_4 4 val_4
NULL NULL 17 val_17
NULL NULL 19 val_19
NULL NULL 20 val_20
Expand Down Expand Up @@ -512,10 +516,10 @@ POSTHOOK: Input: default@smb_bucket_1
POSTHOOK: Input: default@smb_bucket_3
#### A masked pattern was here ####
1 val_1 NULL NULL
10 val_10 10 val_10
3 val_3 NULL NULL
4 val_4 4 val_4
5 val_5 NULL NULL
10 val_10 10 val_10
NULL NULL 17 val_17
NULL NULL 19 val_19
NULL NULL 20 val_20
Expand Down
Loading

0 comments on commit fc4a314

Please sign in to comment.