-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
274 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set hive.cbo.returnpath.hiveop=true; | ||
|
||
create table t1 (a string, b int); | ||
|
||
insert into t1 values ('2014-03-14 10:10:12', 10); | ||
|
||
-- distribute by | ||
explain cbo | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a; | ||
explain | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a; | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a; | ||
|
||
-- distribute by and sort by | ||
explain cbo | ||
select * from t1 distribute by a, b sort by a; | ||
|
||
explain | ||
select * from t1 distribute by a, b sort by a; | ||
|
||
-- cluster by | ||
explain cbo | ||
select * from t1 cluster by a, b; | ||
|
||
explain | ||
select * from t1 cluster by a, b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
242 changes: 242 additions & 0 deletions
242
ql/src/test/results/clientpositive/llap/distributeby_cboret.q.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
PREHOOK: query: create table t1 (a string, b int) | ||
PREHOOK: type: CREATETABLE | ||
PREHOOK: Output: database:default | ||
PREHOOK: Output: default@t1 | ||
POSTHOOK: query: create table t1 (a string, b int) | ||
POSTHOOK: type: CREATETABLE | ||
POSTHOOK: Output: database:default | ||
POSTHOOK: Output: default@t1 | ||
PREHOOK: query: insert into t1 values ('2014-03-14 10:10:12', 10) | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: _dummy_database@_dummy_table | ||
PREHOOK: Output: default@t1 | ||
POSTHOOK: query: insert into t1 values ('2014-03-14 10:10:12', 10) | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: _dummy_database@_dummy_table | ||
POSTHOOK: Output: default@t1 | ||
POSTHOOK: Lineage: t1.a SCRIPT [] | ||
POSTHOOK: Lineage: t1.b SCRIPT [] | ||
PREHOOK: query: explain cbo | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: explain cbo | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
PREHOOK: query: explain | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: explain | ||
select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
STAGE DEPENDENCIES: | ||
Stage-1 is a root stage | ||
Stage-0 depends on stages: Stage-1 | ||
|
||
STAGE PLANS: | ||
Stage: Stage-1 | ||
Tez | ||
#### A masked pattern was here #### | ||
Edges: | ||
Reducer 2 <- Map 1 (CUSTOM_SIMPLE_EDGE) | ||
#### A masked pattern was here #### | ||
Vertices: | ||
Map 1 | ||
Map Operator Tree: | ||
TableScan | ||
alias: t1 | ||
filterExpr: CAST( a AS DATE) BETWEEN DATE'2014-03-13' AND DATE'2014-03-14' (type: boolean) | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Filter Operator | ||
predicate: CAST( a AS DATE) BETWEEN DATE'2014-03-13' AND DATE'2014-03-14' (type: boolean) | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Select Operator | ||
expressions: a (type: string), b (type: int) | ||
outputColumnNames: a, b | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Reduce Output Operator | ||
null sort order: | ||
sort order: | ||
Map-reduce partition columns: a (type: string) | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
value expressions: a (type: string), b (type: int) | ||
Execution mode: vectorized, llap | ||
LLAP IO: all inputs | ||
Reducer 2 | ||
Execution mode: vectorized, llap | ||
Reduce Operator Tree: | ||
Select Operator | ||
expressions: VALUE.a (type: string), VALUE.b (type: int) | ||
outputColumnNames: a, b | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
File Output Operator | ||
compressed: false | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
table: | ||
input format: org.apache.hadoop.mapred.SequenceFileInputFormat | ||
output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat | ||
serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe | ||
|
||
Stage: Stage-0 | ||
Fetch Operator | ||
limit: -1 | ||
Processor Tree: | ||
ListSink | ||
|
||
PREHOOK: query: select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: select * from t1 where a between date_add('2014-03-14', -1) and '2014-03-14' distribute by a | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
2014-03-14 10:10:12 10 | ||
PREHOOK: query: explain cbo | ||
select * from t1 distribute by a, b sort by a | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: explain cbo | ||
select * from t1 distribute by a, b sort by a | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
PREHOOK: query: explain | ||
select * from t1 distribute by a, b sort by a | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: explain | ||
select * from t1 distribute by a, b sort by a | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
STAGE DEPENDENCIES: | ||
Stage-1 is a root stage | ||
Stage-0 depends on stages: Stage-1 | ||
|
||
STAGE PLANS: | ||
Stage: Stage-1 | ||
Tez | ||
#### A masked pattern was here #### | ||
Edges: | ||
Reducer 2 <- Map 1 (SIMPLE_EDGE) | ||
#### A masked pattern was here #### | ||
Vertices: | ||
Map 1 | ||
Map Operator Tree: | ||
TableScan | ||
alias: t1 | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Select Operator | ||
expressions: a (type: string), b (type: int) | ||
outputColumnNames: a, b | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Reduce Output Operator | ||
key expressions: a (type: string) | ||
null sort order: z | ||
sort order: + | ||
Map-reduce partition columns: a (type: string), b (type: int) | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
value expressions: b (type: int) | ||
Execution mode: vectorized, llap | ||
LLAP IO: all inputs | ||
Reducer 2 | ||
Execution mode: vectorized, llap | ||
Reduce Operator Tree: | ||
Select Operator | ||
expressions: KEY.reducesinkkey0 (type: string), VALUE.b (type: int) | ||
outputColumnNames: a, b | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
File Output Operator | ||
compressed: false | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
table: | ||
input format: org.apache.hadoop.mapred.SequenceFileInputFormat | ||
output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat | ||
serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe | ||
|
||
Stage: Stage-0 | ||
Fetch Operator | ||
limit: -1 | ||
Processor Tree: | ||
ListSink | ||
|
||
PREHOOK: query: explain cbo | ||
select * from t1 cluster by a, b | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: explain cbo | ||
select * from t1 cluster by a, b | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
PREHOOK: query: explain | ||
select * from t1 cluster by a, b | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: explain | ||
select * from t1 cluster by a, b | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@t1 | ||
#### A masked pattern was here #### | ||
STAGE DEPENDENCIES: | ||
Stage-1 is a root stage | ||
Stage-0 depends on stages: Stage-1 | ||
|
||
STAGE PLANS: | ||
Stage: Stage-1 | ||
Tez | ||
#### A masked pattern was here #### | ||
Edges: | ||
Reducer 2 <- Map 1 (SIMPLE_EDGE) | ||
#### A masked pattern was here #### | ||
Vertices: | ||
Map 1 | ||
Map Operator Tree: | ||
TableScan | ||
alias: t1 | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Select Operator | ||
expressions: a (type: string), b (type: int) | ||
outputColumnNames: a, b | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Reduce Output Operator | ||
key expressions: a (type: string), b (type: int) | ||
null sort order: aa | ||
sort order: ++ | ||
Map-reduce partition columns: a (type: string), b (type: int) | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
Execution mode: vectorized, llap | ||
LLAP IO: all inputs | ||
Reducer 2 | ||
Execution mode: vectorized, llap | ||
Reduce Operator Tree: | ||
Select Operator | ||
expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: int) | ||
outputColumnNames: a, b | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
File Output Operator | ||
compressed: false | ||
Statistics: Num rows: 1 Data size: 107 Basic stats: COMPLETE Column stats: COMPLETE | ||
table: | ||
input format: org.apache.hadoop.mapred.SequenceFileInputFormat | ||
output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat | ||
serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe | ||
|
||
Stage: Stage-0 | ||
Fetch Operator | ||
limit: -1 | ||
Processor Tree: | ||
ListSink | ||
|