PREHOOK: query: drop table if exists test_join_1 PREHOOK: type: DROPTABLE POSTHOOK: query: drop table if exists test_join_1 POSTHOOK: type: DROPTABLE PREHOOK: query: drop table if exists test_join_2 PREHOOK: type: DROPTABLE POSTHOOK: query: drop table if exists test_join_2 POSTHOOK: type: DROPTABLE PREHOOK: query: create table test_join_1(a string, b string) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@test_join_1 POSTHOOK: query: create table test_join_1(a string, b string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@test_join_1 PREHOOK: query: create table test_join_2(a string, b string) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@test_join_2 POSTHOOK: query: create table test_join_2(a string, b string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@test_join_2 PREHOOK: query: explain select * from ( SELECT a a, b b FROM test_join_1 )t1 join ( SELECT a a, b b FROM test_join_1 )t2 on t1.a = t2.a and t1.a = t2.b join ( select a from test_join_2 )t3 on t1.a = t3.a PREHOOK: type: QUERY POSTHOOK: query: explain select * from ( SELECT a a, b b FROM test_join_1 )t1 join ( SELECT a a, b b FROM test_join_1 )t2 on t1.a = t2.a and t1.a = t2.b join ( select a from test_join_2 )t3 on t1.a = t3.a POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage Stage-2 depends on stages: Stage-1 Stage-0 depends on stages: Stage-2 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: test_join_1 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Filter Operator predicate: a is not null (type: boolean) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Select Operator expressions: a (type: string), b (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string), _col0 (type: string) sort order: ++ Map-reduce partition columns: _col0 (type: string), _col0 (type: string) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE value expressions: _col1 (type: string) TableScan alias: test_join_1 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Filter Operator predicate: (a is not null and b is not null) (type: boolean) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Select Operator expressions: a (type: string), b (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string), _col1 (type: string) sort order: ++ Map-reduce partition columns: _col0 (type: string), _col1 (type: string) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 keys: 0 _col0 (type: string), _col0 (type: string) 1 _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1, _col2, _col3 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE File Output Operator compressed: false table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe Stage: Stage-2 Map Reduce Map Operator Tree: TableScan Reduce Output Operator key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: string) TableScan alias: test_join_2 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Filter Operator predicate: a is not null (type: boolean) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Select Operator expressions: a (type: string) outputColumnNames: _col0 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Reduce Operator Tree: Join Operator condition map: Inner Join 0 to 1 keys: 0 _col0 (type: string) 1 _col0 (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: ListSink PREHOOK: query: drop table test_join_1 PREHOOK: type: DROPTABLE PREHOOK: Input: default@test_join_1 PREHOOK: Output: default@test_join_1 POSTHOOK: query: drop table test_join_1 POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@test_join_1 POSTHOOK: Output: default@test_join_1 PREHOOK: query: drop table test_join_2 PREHOOK: type: DROPTABLE PREHOOK: Input: default@test_join_2 PREHOOK: Output: default@test_join_2 POSTHOOK: query: drop table test_join_2 POSTHOOK: type: DROPTABLE POSTHOOK: Input: default@test_join_2 POSTHOOK: Output: default@test_join_2