http://git-wip-us.apache.org/repos/asf/hive/blob/6e9b63e4/ql/src/test/results/clientpositive/auto_sortmerge_join_4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_sortmerge_join_4.q.out 
b/ql/src/test/results/clientpositive/auto_sortmerge_join_4.q.out
index 0d586fd..b54c574 100644
--- a/ql/src/test/results/clientpositive/auto_sortmerge_join_4.q.out
+++ b/ql/src/test/results/clientpositive/auto_sortmerge_join_4.q.out
@@ -72,11 +72,11 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/sm
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_small@ds=2008-04-09
-PREHOOK: query: CREATE TABLE bucket_big (key string, value string) partitioned 
by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 2 BUCKETS STORED AS 
TEXTFILE
+PREHOOK: query: CREATE TABLE bucket_big (key string, value string) partitioned 
by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 4 BUCKETS STORED AS 
TEXTFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
 PREHOOK: Output: default@bucket_big
-POSTHOOK: query: CREATE TABLE bucket_big (key string, value string) 
partitioned by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 2 BUCKETS 
STORED AS TEXTFILE
+POSTHOOK: query: CREATE TABLE bucket_big (key string, value string) 
partitioned by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 4 BUCKETS 
STORED AS TEXTFILE
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@bucket_big
@@ -97,6 +97,22 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/bi
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_big@ds=2008-04-08
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big@ds=2008-04-08
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big@ds=2008-04-08
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big@ds=2008-04-08
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big@ds=2008-04-08
 PREHOOK: query: explain extended select count(*) FROM bucket_small a JOIN 
bucket_big b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_small a JOIN 
bucket_big b ON a.key = b.key
@@ -111,16 +127,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: b
-            Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 56 Data size: 27500 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 120 Data size: 58120 Basic stats: 
COMPLETE Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -150,7 +166,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -158,7 +174,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -166,7 +182,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -174,7 +190,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -243,7 +259,7 @@ POSTHOOK: Input: default@bucket_small
 POSTHOOK: Input: default@bucket_small@ds=2008-04-08
 POSTHOOK: Input: default@bucket_small@ds=2008-04-09
 #### A masked pattern was here ####
-38
+78
 PREHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
@@ -258,16 +274,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 56 Data size: 27500 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 120 Data size: 58120 Basic stats: 
COMPLETE Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -297,7 +313,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -305,7 +321,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -313,7 +329,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -321,7 +337,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -390,7 +406,7 @@ POSTHOOK: Input: default@bucket_small
 POSTHOOK: Input: default@bucket_small@ds=2008-04-08
 POSTHOOK: Input: default@bucket_small@ds=2008-04-09
 #### A masked pattern was here ####
-38
+78
 PREHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
@@ -534,16 +550,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 56 Data size: 27500 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 120 Data size: 58120 Basic stats: 
COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -574,7 +590,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -582,7 +598,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -590,7 +606,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -598,7 +614,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -755,7 +771,7 @@ STAGE PLANS:
                   partition values:
                     ds 2008-04-08
                   properties:
-                    bucket_count 2
+                    bucket_count 4
                     bucket_field_name key
                     column.name.delimiter ,
                     columns key,value
@@ -763,7 +779,7 @@ STAGE PLANS:
                     columns.types string:string
 #### A masked pattern was here ####
                     name default.bucket_big
-                    numFiles 2
+                    numFiles 4
                     numRows 0
                     partition_columns ds
                     partition_columns.types string
@@ -771,7 +787,7 @@ STAGE PLANS:
                     serialization.ddl struct bucket_big { string key, string 
value}
                     serialization.format 1
                     serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                    totalSize 2750
+                    totalSize 5812
 #### A masked pattern was here ####
                   serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
                 
@@ -779,7 +795,7 @@ STAGE PLANS:
                     output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
                     properties:
                       SORTBUCKETCOLSPREFIX TRUE
-                      bucket_count 2
+                      bucket_count 4
                       bucket_field_name key
                       column.name.delimiter ,
                       columns key,value
@@ -800,16 +816,16 @@ STAGE PLANS:
         $hdt$_0:a 
           TableScan
             alias: a
-            Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 56 Data size: 27500 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 120 Data size: 58120 Basic stats: 
COMPLETE Column stats: NONE
                 HashTable Sink Operator
                   keys:
                     0 _col0 (type: string)
@@ -861,7 +877,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -869,7 +885,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -877,7 +893,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -885,7 +901,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -1034,16 +1050,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 56 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 120 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 56 Data size: 27500 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 120 Data size: 58120 Basic stats: 
COMPLETE Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -1073,7 +1089,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -1081,7 +1097,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -1089,7 +1105,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -1097,7 +1113,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -1166,4 +1182,4 @@ POSTHOOK: Input: default@bucket_small
 POSTHOOK: Input: default@bucket_small@ds=2008-04-08
 POSTHOOK: Input: default@bucket_small@ds=2008-04-09
 #### A masked pattern was here ####
-38
+78

http://git-wip-us.apache.org/repos/asf/hive/blob/6e9b63e4/ql/src/test/results/clientpositive/auto_sortmerge_join_5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_sortmerge_join_5.q.out 
b/ql/src/test/results/clientpositive/auto_sortmerge_join_5.q.out
index 45704d1..451c3b3 100644
--- a/ql/src/test/results/clientpositive/auto_sortmerge_join_5.q.out
+++ b/ql/src/test/results/clientpositive/auto_sortmerge_join_5.q.out
@@ -1,8 +1,8 @@
-PREHOOK: query: CREATE TABLE bucket_small (key string, value string) CLUSTERED 
BY (key) SORTED BY (key) INTO 4 BUCKETS STORED AS TEXTFILE
+PREHOOK: query: CREATE TABLE bucket_small (key string, value string) CLUSTERED 
BY (key) SORTED BY (key) INTO 2 BUCKETS STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
 PREHOOK: Output: default@bucket_small
-POSTHOOK: query: CREATE TABLE bucket_small (key string, value string) 
CLUSTERED BY (key) SORTED BY (key) INTO 4 BUCKETS STORED AS TEXTFILE
+POSTHOOK: query: CREATE TABLE bucket_small (key string, value string) 
CLUSTERED BY (key) SORTED BY (key) INTO 2 BUCKETS STORED AS TEXTFILE
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@bucket_small
@@ -22,27 +22,11 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/sm
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_small
-PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/small/000002_0' INTO TABLE bucket_small
-PREHOOK: type: LOAD
-#### A masked pattern was here ####
-PREHOOK: Output: default@bucket_small
-POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/small/000002_0' INTO TABLE bucket_small
-POSTHOOK: type: LOAD
-#### A masked pattern was here ####
-POSTHOOK: Output: default@bucket_small
-PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/small/000003_0' INTO TABLE bucket_small
-PREHOOK: type: LOAD
-#### A masked pattern was here ####
-PREHOOK: Output: default@bucket_small
-POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/small/000003_0' INTO TABLE bucket_small
-POSTHOOK: type: LOAD
-#### A masked pattern was here ####
-POSTHOOK: Output: default@bucket_small
-PREHOOK: query: CREATE TABLE bucket_big (key string, value string) CLUSTERED 
BY (key) SORTED BY (key) INTO 2 BUCKETS STORED AS TEXTFILE
+PREHOOK: query: CREATE TABLE bucket_big (key string, value string) CLUSTERED 
BY (key) SORTED BY (key) INTO 4 BUCKETS STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
 PREHOOK: Output: default@bucket_big
-POSTHOOK: query: CREATE TABLE bucket_big (key string, value string) CLUSTERED 
BY (key) SORTED BY (key) INTO 2 BUCKETS STORED AS TEXTFILE
+POSTHOOK: query: CREATE TABLE bucket_big (key string, value string) CLUSTERED 
BY (key) SORTED BY (key) INTO 4 BUCKETS STORED AS TEXTFILE
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@bucket_big
@@ -62,6 +46,22 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/bi
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_big
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big
 PREHOOK: query: explain extended select count(*) FROM bucket_small a JOIN 
bucket_big b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_small a JOIN 
bucket_big b ON a.key = b.key
@@ -76,16 +76,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: b
-            Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -114,7 +114,7 @@ STAGE PLANS:
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
               SORTBUCKETCOLSPREFIX TRUE
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -122,13 +122,13 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               rawDataSize 0
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -136,7 +136,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -144,13 +144,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_big
-                numFiles 2
+                numFiles 4
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_big { string key, string value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 2750
+                totalSize 5812
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_big
@@ -216,16 +216,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -254,7 +254,7 @@ STAGE PLANS:
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
               SORTBUCKETCOLSPREFIX TRUE
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -262,13 +262,13 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               rawDataSize 0
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -276,7 +276,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -284,13 +284,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_big
-                numFiles 2
+                numFiles 4
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_big { string key, string value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 2750
+                totalSize 5812
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_big
@@ -369,16 +369,16 @@ STAGE PLANS:
         $hdt$_1:b 
           TableScan
             alias: b
-            Statistics: Num rows: 1 Data size: 2260 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 1140 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 2260 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 1140 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 2260 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 1140 Basic stats: COMPLETE 
Column stats: NONE
                 HashTable Sink Operator
                   keys:
                     0 _col0 (type: string)
@@ -390,16 +390,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
                 Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -429,7 +429,7 @@ STAGE PLANS:
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
               SORTBUCKETCOLSPREFIX TRUE
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -437,13 +437,13 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               rawDataSize 0
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -451,7 +451,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -459,13 +459,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_big
-                numFiles 2
+                numFiles 4
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_big { string key, string value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 2750
+                totalSize 5812
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_big
@@ -475,7 +475,7 @@ STAGE PLANS:
             input format: org.apache.hadoop.mapred.TextInputFormat
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
-              bucket_count 4
+              bucket_count 2
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -492,7 +492,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 4
+                bucket_count 2
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -500,13 +500,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_small
-                numFiles 4
+                numFiles 2
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_small { string key, string 
value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 226
+                totalSize 114
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_small
@@ -551,16 +551,16 @@ STAGE PLANS:
         $hdt$_0:a 
           TableScan
             alias: a
-            Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
                 HashTable Sink Operator
                   keys:
                     0 _col0 (type: string)
@@ -572,16 +572,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: b
-            Statistics: Num rows: 1 Data size: 2260 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 1140 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 2260 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 1140 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 2260 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 1140 Basic stats: COMPLETE 
Column stats: NONE
                 Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -611,7 +611,7 @@ STAGE PLANS:
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
               SORTBUCKETCOLSPREFIX TRUE
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -619,13 +619,13 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               rawDataSize 0
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -633,7 +633,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -641,13 +641,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_big
-                numFiles 2
+                numFiles 4
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_big { string key, string value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 2750
+                totalSize 5812
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_big
@@ -657,7 +657,7 @@ STAGE PLANS:
             input format: org.apache.hadoop.mapred.TextInputFormat
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
-              bucket_count 4
+              bucket_count 2
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -674,7 +674,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 4
+                bucket_count 2
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -682,13 +682,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_small
-                numFiles 4
+                numFiles 2
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_small { string key, string 
value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 226
+                totalSize 114
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_small
@@ -728,16 +728,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 27500 Basic stats: COMPLETE 
Column stats: NONE
+                Statistics: Num rows: 1 Data size: 58120 Basic stats: COMPLETE 
Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -766,7 +766,7 @@ STAGE PLANS:
             output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
             properties:
               SORTBUCKETCOLSPREFIX TRUE
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -774,13 +774,13 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               rawDataSize 0
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -788,7 +788,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -796,13 +796,13 @@ STAGE PLANS:
                 columns.types string:string
 #### A masked pattern was here ####
                 name default.bucket_big
-                numFiles 2
+                numFiles 4
                 numRows 0
                 rawDataSize 0
                 serialization.ddl struct bucket_big { string key, string value}
                 serialization.format 1
                 serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                totalSize 2750
+                totalSize 5812
 #### A masked pattern was here ####
               serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
               name: default.bucket_big

http://git-wip-us.apache.org/repos/asf/hive/blob/6e9b63e4/ql/src/test/results/clientpositive/auto_sortmerge_join_7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_sortmerge_join_7.q.out 
b/ql/src/test/results/clientpositive/auto_sortmerge_join_7.q.out
index 1959075..f335142 100644
--- a/ql/src/test/results/clientpositive/auto_sortmerge_join_7.q.out
+++ b/ql/src/test/results/clientpositive/auto_sortmerge_join_7.q.out
@@ -72,11 +72,11 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/sm
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_small@ds=2008-04-09
-PREHOOK: query: CREATE TABLE bucket_big (key string, value string) partitioned 
by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 2 BUCKETS STORED AS 
TEXTFILE
+PREHOOK: query: CREATE TABLE bucket_big (key string, value string) partitioned 
by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 4 BUCKETS STORED AS 
TEXTFILE
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
 PREHOOK: Output: default@bucket_big
-POSTHOOK: query: CREATE TABLE bucket_big (key string, value string) 
partitioned by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 2 BUCKETS 
STORED AS TEXTFILE
+POSTHOOK: query: CREATE TABLE bucket_big (key string, value string) 
partitioned by (ds string) CLUSTERED BY (key) SORTED BY (key) INTO 4 BUCKETS 
STORED AS TEXTFILE
 POSTHOOK: type: CREATETABLE
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@bucket_big
@@ -97,6 +97,22 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/bi
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_big@ds=2008-04-08
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big@ds=2008-04-08
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big@ds=2008-04-08
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big@ds=2008-04-08
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big 
partition(ds='2008-04-08')
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big@ds=2008-04-08
 PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000000_0' INTO TABLE bucket_big 
partition(ds='2008-04-09')
 PREHOOK: type: LOAD
 #### A masked pattern was here ####
@@ -114,6 +130,22 @@ POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/bi
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_big@ds=2008-04-09
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big 
partition(ds='2008-04-09')
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big@ds=2008-04-09
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000002_0' INTO TABLE bucket_big 
partition(ds='2008-04-09')
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big@ds=2008-04-09
+PREHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big 
partition(ds='2008-04-09')
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@bucket_big@ds=2008-04-09
+POSTHOOK: query: load data local inpath 
'../../data/files/auto_sortmerge_join/big/000003_0' INTO TABLE bucket_big 
partition(ds='2008-04-09')
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@bucket_big@ds=2008-04-09
 PREHOOK: query: explain extended select count(*) FROM bucket_small a JOIN 
bucket_big b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_small a JOIN 
bucket_big b ON a.key = b.key
@@ -128,16 +160,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: b
-            Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 240 Data size: 116240 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 112 Data size: 55000 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -167,7 +199,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -175,7 +207,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -183,7 +215,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -191,7 +223,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -216,7 +248,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-09
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -224,7 +256,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -232,7 +264,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -240,7 +272,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -312,7 +344,7 @@ POSTHOOK: Input: default@bucket_small
 POSTHOOK: Input: default@bucket_small@ds=2008-04-08
 POSTHOOK: Input: default@bucket_small@ds=2008-04-09
 #### A masked pattern was here ####
-76
+156
 PREHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
@@ -327,16 +359,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 240 Data size: 116240 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 112 Data size: 55000 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -366,7 +398,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -374,7 +406,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -382,7 +414,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -390,7 +422,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -415,7 +447,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-09
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -423,7 +455,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -431,7 +463,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -439,7 +471,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -511,7 +543,7 @@ POSTHOOK: Input: default@bucket_small
 POSTHOOK: Input: default@bucket_small@ds=2008-04-08
 POSTHOOK: Input: default@bucket_small@ds=2008-04-09
 #### A masked pattern was here ####
-76
+156
 PREHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_big a JOIN 
bucket_small b ON a.key = b.key
@@ -655,16 +687,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 240 Data size: 116240 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 112 Data size: 55000 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
                 Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -695,7 +727,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -703,7 +735,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -711,7 +743,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -719,7 +751,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -744,7 +776,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-09
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -752,7 +784,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -760,7 +792,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -768,7 +800,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -926,7 +958,7 @@ STAGE PLANS:
                   partition values:
                     ds 2008-04-08
                   properties:
-                    bucket_count 2
+                    bucket_count 4
                     bucket_field_name key
                     column.name.delimiter ,
                     columns key,value
@@ -934,7 +966,7 @@ STAGE PLANS:
                     columns.types string:string
 #### A masked pattern was here ####
                     name default.bucket_big
-                    numFiles 2
+                    numFiles 4
                     numRows 0
                     partition_columns ds
                     partition_columns.types string
@@ -942,7 +974,7 @@ STAGE PLANS:
                     serialization.ddl struct bucket_big { string key, string 
value}
                     serialization.format 1
                     serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                    totalSize 2750
+                    totalSize 5812
 #### A masked pattern was here ####
                   serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
                 
@@ -950,7 +982,7 @@ STAGE PLANS:
                     output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
                     properties:
                       SORTBUCKETCOLSPREFIX TRUE
-                      bucket_count 2
+                      bucket_count 4
                       bucket_field_name key
                       column.name.delimiter ,
                       columns key,value
@@ -974,7 +1006,7 @@ STAGE PLANS:
                   partition values:
                     ds 2008-04-09
                   properties:
-                    bucket_count 2
+                    bucket_count 4
                     bucket_field_name key
                     column.name.delimiter ,
                     columns key,value
@@ -982,7 +1014,7 @@ STAGE PLANS:
                     columns.types string:string
 #### A masked pattern was here ####
                     name default.bucket_big
-                    numFiles 2
+                    numFiles 4
                     numRows 0
                     partition_columns ds
                     partition_columns.types string
@@ -990,7 +1022,7 @@ STAGE PLANS:
                     serialization.ddl struct bucket_big { string key, string 
value}
                     serialization.format 1
                     serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-                    totalSize 2750
+                    totalSize 5812
 #### A masked pattern was here ####
                   serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
                 
@@ -998,7 +1030,7 @@ STAGE PLANS:
                     output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
                     properties:
                       SORTBUCKETCOLSPREFIX TRUE
-                      bucket_count 2
+                      bucket_count 4
                       bucket_field_name key
                       column.name.delimiter ,
                       columns key,value
@@ -1019,16 +1051,16 @@ STAGE PLANS:
         $hdt$_0:a 
           TableScan
             alias: a
-            Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 240 Data size: 116240 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 112 Data size: 55000 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
                 HashTable Sink Operator
                   keys:
                     0 _col0 (type: string)
@@ -1080,7 +1112,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -1088,7 +1120,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -1096,7 +1128,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -1104,7 +1136,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -1129,7 +1161,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-09
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -1137,7 +1169,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -1145,7 +1177,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -1153,7 +1185,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -1302,16 +1334,16 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+            Statistics: Num rows: 240 Data size: 116240 Basic stats: COMPLETE 
Column stats: NONE
             GatherStats: false
             Filter Operator
               isSamplingPred: false
               predicate: key is not null (type: boolean)
-              Statistics: Num rows: 112 Data size: 55000 Basic stats: COMPLETE 
Column stats: NONE
+              Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
-                Statistics: Num rows: 112 Data size: 55000 Basic stats: 
COMPLETE Column stats: NONE
+                Statistics: Num rows: 240 Data size: 116240 Basic stats: 
COMPLETE Column stats: NONE
                 Sorted Merge Bucket Map Join Operator
                   condition map:
                        Inner Join 0 to 1
@@ -1341,7 +1373,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-08
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -1349,7 +1381,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -1357,7 +1389,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -1365,7 +1397,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -1390,7 +1422,7 @@ STAGE PLANS:
             partition values:
               ds 2008-04-09
             properties:
-              bucket_count 2
+              bucket_count 4
               bucket_field_name key
               column.name.delimiter ,
               columns key,value
@@ -1398,7 +1430,7 @@ STAGE PLANS:
               columns.types string:string
 #### A masked pattern was here ####
               name default.bucket_big
-              numFiles 2
+              numFiles 4
               numRows 0
               partition_columns ds
               partition_columns.types string
@@ -1406,7 +1438,7 @@ STAGE PLANS:
               serialization.ddl struct bucket_big { string key, string value}
               serialization.format 1
               serialization.lib 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-              totalSize 2750
+              totalSize 5812
 #### A masked pattern was here ####
             serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           
@@ -1414,7 +1446,7 @@ STAGE PLANS:
               output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
               properties:
                 SORTBUCKETCOLSPREFIX TRUE
-                bucket_count 2
+                bucket_count 4
                 bucket_field_name key
                 column.name.delimiter ,
                 columns key,value
@@ -1486,4 +1518,4 @@ POSTHOOK: Input: default@bucket_small
 POSTHOOK: Input: default@bucket_small@ds=2008-04-08
 POSTHOOK: Input: default@bucket_small@ds=2008-04-09
 #### A masked pattern was here ####
-76
+156

Reply via email to