http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/metadataonly1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/metadataonly1.q.out 
b/ql/src/test/results/clientpositive/tez/metadataonly1.q.out
index 3b9b51d..1961d1b 100644
--- a/ql/src/test/results/clientpositive/tez/metadataonly1.q.out
+++ b/ql/src/test/results/clientpositive/tez/metadataonly1.q.out
@@ -57,6 +57,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -166,6 +167,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -316,6 +318,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
+                        null sort order: a
                         sort order: +
                         Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                         tag: -1
@@ -463,6 +466,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -646,6 +650,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col0 (type: string)
+                      null sort order: a
                       sort order: +
                       Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
@@ -753,6 +758,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -861,6 +867,7 @@ STAGE PLANS:
                   outputColumnNames: _col0
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                   Reduce Output Operator
+                    null sort order: 
                     sort order: 
                     Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
                     tag: -1
@@ -910,6 +917,7 @@ STAGE PLANS:
                   Statistics: Num rows: 1 Data size: 84 Basic stats: COMPLETE 
Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col0 (type: string)
+                    null sort order: a
                     sort order: +
                     Map-reduce partition columns: _col0 (type: string)
                     Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
@@ -1038,6 +1046,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string), _col1 (type: 
string)
+                        null sort order: aa
                         sort order: ++
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
@@ -1284,6 +1293,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
@@ -1523,6 +1533,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 84 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -1773,6 +1784,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string), _col1 (type: 
string)
+                        null sort order: aa
                         sort order: ++
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out 
b/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
index 4b04177..336a5e9 100644
--- a/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
+++ b/ql/src/test/results/clientpositive/tez/optimize_nullscan.q.out
@@ -122,6 +122,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
@@ -270,6 +271,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
@@ -337,6 +339,7 @@ STAGE PLANS:
                       Number of rows: 0
                       Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                         tag: -1
@@ -579,6 +582,7 @@ STAGE PLANS:
                   Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col0 (type: string)
+                    null sort order: a
                     sort order: +
                     Map-reduce partition columns: _col0 (type: string)
                     Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
@@ -692,6 +696,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -761,6 +766,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -1130,6 +1136,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
                         tag: 0
@@ -1197,6 +1204,7 @@ STAGE PLANS:
                       Number of rows: 0
                       Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                         tag: -1
@@ -1438,6 +1446,7 @@ STAGE PLANS:
                   Number of rows: 0
                   Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                   Reduce Output Operator
+                    null sort order: 
                     sort order: 
                     Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 
Column stats: NONE
                     tag: 1
@@ -1644,6 +1653,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: key (type: string)
+                      null sort order: a
                       sort order: +
                       Map-reduce partition columns: key (type: string)
                       Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
@@ -1709,6 +1719,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                     Reduce Output Operator
                       key expressions: key (type: string)
+                      null sort order: a
                       sort order: +
                       Map-reduce partition columns: key (type: string)
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
@@ -1831,6 +1842,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: value (type: string)
+                      null sort order: a
                       sort order: +
                       Map-reduce partition columns: value (type: string)
                       Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
@@ -1897,6 +1909,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: value (type: string)
+                      null sort order: a
                       sort order: +
                       Map-reduce partition columns: value (type: string)
                       Statistics: Num rows: 1 Data size: 10 Basic stats: 
COMPLETE Column stats: NONE
@@ -2060,6 +2073,7 @@ STAGE PLANS:
                       outputColumnNames: _col0
                       Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: COMPLETE
                       Reduce Output Operator
+                        null sort order: 
                         sort order: 
                         Statistics: Num rows: 1 Data size: 8 Basic stats: 
COMPLETE Column stats: COMPLETE
                         tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/orc_analyze.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/orc_analyze.q.out 
b/ql/src/test/results/clientpositive/tez/orc_analyze.q.out
index 87855fa..9b7e7b7 100644
--- a/ql/src/test/results/clientpositive/tez/orc_analyze.q.out
+++ b/ql/src/test/results/clientpositive/tez/orc_analyze.q.out
@@ -917,7 +917,7 @@ OutputFormat:               
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: desc formatted orc_create_people partition(state="Or")
@@ -960,7 +960,7 @@ OutputFormat:               
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: analyze table orc_create_people partition(state) compute 
statistics partialscan
@@ -1015,7 +1015,7 @@ OutputFormat:             
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: desc formatted orc_create_people partition(state="Or")
@@ -1058,7 +1058,7 @@ OutputFormat:             
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: analyze table orc_create_people partition(state) compute 
statistics noscan
@@ -1113,7 +1113,7 @@ OutputFormat:             
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: desc formatted orc_create_people partition(state="Or")
@@ -1156,7 +1156,7 @@ OutputFormat:             
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: drop table orc_create_people
@@ -1262,7 +1262,7 @@ OutputFormat:             
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: desc formatted orc_create_people partition(state="Or")
@@ -1305,7 +1305,7 @@ OutputFormat:             
org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [first_name]             
-Sort Columns:          [Order(col:last_name, order:1)]  
+Sort Columns:          [Order(col:last_name, order:1, nullOrder:0)]     
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: drop table orc_create_people

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/order_null.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/order_null.q.out 
b/ql/src/test/results/clientpositive/tez/order_null.q.out
new file mode 100644
index 0000000..252e348
--- /dev/null
+++ b/ql/src/test/results/clientpositive/tez/order_null.q.out
@@ -0,0 +1,222 @@
+PREHOOK: query: create table src_null (a int, b string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src_null
+POSTHOOK: query: create table src_null (a int, b string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src_null
+PREHOOK: query: insert into src_null values (1, 'A')
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@src_null
+POSTHOOK: query: insert into src_null values (1, 'A')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__1
+POSTHOOK: Output: default@src_null
+POSTHOOK: Lineage: src_null.a EXPRESSION 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: src_null.b SIMPLE 
[(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+PREHOOK: query: insert into src_null values (null, null)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__2
+PREHOOK: Output: default@src_null
+POSTHOOK: query: insert into src_null values (null, null)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__2
+POSTHOOK: Output: default@src_null
+POSTHOOK: Lineage: src_null.a EXPRESSION 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: src_null.b SIMPLE 
[(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+PREHOOK: query: insert into src_null values (3, null)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__3
+PREHOOK: Output: default@src_null
+POSTHOOK: query: insert into src_null values (3, null)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__3
+POSTHOOK: Output: default@src_null
+POSTHOOK: Lineage: src_null.a EXPRESSION 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: src_null.b SIMPLE 
[(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+PREHOOK: query: insert into src_null values (2, null)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__4
+PREHOOK: Output: default@src_null
+POSTHOOK: query: insert into src_null values (2, null)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__4
+POSTHOOK: Output: default@src_null
+POSTHOOK: Lineage: src_null.a EXPRESSION 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: src_null.b SIMPLE 
[(values__tmp__table__4)values__tmp__table__4.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+PREHOOK: query: insert into src_null values (2, 'A')
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__5
+PREHOOK: Output: default@src_null
+POSTHOOK: query: insert into src_null values (2, 'A')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__5
+POSTHOOK: Output: default@src_null
+POSTHOOK: Lineage: src_null.a EXPRESSION 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: src_null.b SIMPLE 
[(values__tmp__table__5)values__tmp__table__5.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+PREHOOK: query: insert into src_null values (2, 'B')
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__6
+PREHOOK: Output: default@src_null
+POSTHOOK: query: insert into src_null values (2, 'B')
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__6
+POSTHOOK: Output: default@src_null
+POSTHOOK: Lineage: src_null.a EXPRESSION 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col1, 
type:string, comment:), ]
+POSTHOOK: Lineage: src_null.b SIMPLE 
[(values__tmp__table__6)values__tmp__table__6.FieldSchema(name:tmp_values_col2, 
type:string, comment:), ]
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY a asc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY a asc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+NULL   NULL
+1      A
+2      NULL
+2      A
+2      B
+3      NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY a desc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY a desc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+3      NULL
+2      NULL
+2      A
+2      B
+1      A
+NULL   NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY b asc, a asc nulls last
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY b asc, a asc nulls last
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+2      NULL
+3      NULL
+NULL   NULL
+1      A
+2      A
+2      B
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY b desc, a asc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY b desc, a asc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+2      B
+1      A
+2      A
+NULL   NULL
+2      NULL
+3      NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY a asc nulls first
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY a asc nulls first
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+NULL   NULL
+1      A
+2      NULL
+2      A
+2      B
+3      NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY a desc nulls first
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY a desc nulls first
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+NULL   NULL
+3      NULL
+2      NULL
+2      A
+2      B
+1      A
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY b asc nulls last, a
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY b asc nulls last, a
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+1      A
+2      A
+2      B
+NULL   NULL
+2      NULL
+3      NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY b desc nulls last, a
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY b desc nulls last, a
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+2      B
+1      A
+2      A
+NULL   NULL
+2      NULL
+3      NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY a asc nulls last, b desc
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY a asc nulls last, b desc
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+1      A
+2      B
+2      A
+2      NULL
+3      NULL
+NULL   NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY b desc nulls last, a desc 
nulls last
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY b desc nulls last, a desc 
nulls last
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+2      B
+2      A
+1      A
+3      NULL
+2      NULL
+NULL   NULL
+PREHOOK: query: SELECT x.* FROM src_null x ORDER BY b asc nulls first, a asc 
nulls last
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT x.* FROM src_null x ORDER BY b asc nulls first, a asc 
nulls last
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src_null
+#### A masked pattern was here ####
+2      NULL
+3      NULL
+NULL   NULL
+1      A
+2      A
+2      B

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/ptf.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/ptf.q.out 
b/ql/src/test/results/clientpositive/tez/ptf.q.out
index 8685bdb..b587f8b 100644
--- a/ql/src/test/results/clientpositive/tez/ptf.q.out
+++ b/ql/src/test/results/clientpositive/tez/ptf.q.out
@@ -63,7 +63,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -89,7 +89,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -268,7 +268,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -294,7 +294,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -420,7 +420,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -544,7 +544,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -570,7 +570,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -722,7 +722,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -748,7 +748,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -903,7 +903,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -938,7 +938,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col0
                         raw input shape:
                         window functions:
@@ -1099,7 +1099,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col3: string, _col4: string, _col5: int, _col6: string, _col7: double, 
_col8: string
                         partition by: _col2
                         raw input shape:
@@ -1270,7 +1270,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col3: string, _col4: string, _col5: int, _col6: string, _col7: double, 
_col8: string
                         partition by: _col2
                         raw input shape:
@@ -1378,7 +1378,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: p_name, p_size(DESC)
+                          order by: p_name ASC NULLS FIRST, p_size DESC NULLS 
LAST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int
                           partition by: p_mfgr
                           raw input shape:
@@ -1405,7 +1405,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col1, _col5(DESC)
+                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -1431,7 +1431,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1, _col5(DESC)
+                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1550,7 +1550,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: p_name
+                          order by: p_name ASC NULLS FIRST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int, p_retailprice: double
                           partition by: p_mfgr
                           raw input shape:
@@ -1578,7 +1578,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1605,7 +1605,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1753,7 +1753,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1779,7 +1779,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1930,7 +1930,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2(DESC), _col1
+                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1944,7 +1944,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2(DESC), _col1
+                          order by: _col2 DESC NULLS LAST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1952,7 +1952,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2(DESC), _col1
+                          order by: _col2 DESC NULLS LAST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1979,7 +1979,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2(DESC), _col1
+                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1987,7 +1987,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2(DESC), _col1
+                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -2013,7 +2013,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2171,7 +2171,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -2197,7 +2197,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2365,7 +2365,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col5: int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -2410,7 +2410,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2573,7 +2573,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -2739,7 +2739,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col0
+                        order by: _col0 ASC NULLS FIRST
                         output shape: _col0: string, _col1: string, _col2: 
double
                         partition by: _col0
                         raw input shape:
@@ -2765,7 +2765,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col0
                         raw input shape:
                         window functions:
@@ -2953,7 +2953,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -2985,7 +2985,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -3037,7 +3037,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col5
+                        order by: _col5 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -3073,7 +3073,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col3, _col2
+                        order by: _col3 ASC NULLS FIRST, _col2 ASC NULLS FIRST
                         partition by: _col3
                         raw input shape:
                         window functions:
@@ -3341,14 +3341,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3362,7 +3362,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -3370,7 +3370,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -3397,7 +3397,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3405,7 +3405,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3431,7 +3431,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         partition by: _col2, _col1
                         raw input shape:
                         window functions:
@@ -3613,14 +3613,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3646,7 +3646,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3672,7 +3672,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3698,7 +3698,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -3875,14 +3875,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3908,14 +3908,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3941,7 +3941,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -4119,14 +4119,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4152,7 +4152,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -4166,7 +4166,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -4194,7 +4194,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4221,7 +4221,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         partition by: _col2, _col1
                         raw input shape:
                         window functions:
@@ -4400,7 +4400,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4414,7 +4414,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2
+                          order by: _col2 ASC NULLS FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2
                           raw input shape:
@@ -4422,7 +4422,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2
+                          order by: _col2 ASC NULLS FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2
                           raw input shape:
@@ -4449,7 +4449,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -4457,7 +4457,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -4483,7 +4483,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         partition by: _col2, _col1
                         raw input shape:
                         window functions:
@@ -4656,14 +4656,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4677,7 +4677,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -4705,7 +4705,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4732,7 +4732,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/ptf_matchpath.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/ptf_matchpath.q.out 
b/ql/src/test/results/clientpositive/tez/ptf_matchpath.q.out
index af88634..8ca3196 100644
--- a/ql/src/test/results/clientpositive/tez/ptf_matchpath.q.out
+++ b/ql/src/test/results/clientpositive/tez/ptf_matchpath.q.out
@@ -101,7 +101,7 @@ STAGE PLANS:
                         input alias: ptf_1
                         arguments: 'LATE.LATE+', 'LATE', (_col5 > 15.0), 
'origin_city_name, fl_num, year, month, day_of_month, size(tpath) as sz, 
tpath[0].day_of_month as tpath'
                         name: matchpath
-                        order by: _col2, _col3, _col4
+                        order by: _col2 ASC NULLS FIRST, _col3 ASC NULLS 
FIRST, _col4 ASC NULLS FIRST
                         output shape: tpath: int
                         partition by: _col6
                         raw input shape:
@@ -228,7 +228,7 @@ STAGE PLANS:
                         input alias: ptf_1
                         arguments: 'LATE.LATE+', 'LATE', (_col5 > 15.0), 
'origin_city_name, fl_num, year, month, day_of_month, size(tpath) as sz, 
tpath[0].day_of_month as tpath'
                         name: matchpath
-                        order by: _col6, _col2, _col3, _col4
+                        order by: _col6 ASC NULLS FIRST, _col2 ASC NULLS 
FIRST, _col3 ASC NULLS FIRST, _col4 ASC NULLS FIRST
                         output shape: tpath: int
                         partition by: 0
                         raw input shape:
@@ -352,7 +352,7 @@ STAGE PLANS:
                         input alias: ptf_1
                         arguments: 'LATE.LATE+', 'LATE', (_col5 > 15.0), 
'origin_city_name, fl_num, year, month, day_of_month, size(tpath) as sz, 
tpath[0].day_of_month as tpath'
                         name: matchpath
-                        order by: _col6, _col2, _col3, _col4
+                        order by: _col6 ASC NULLS FIRST, _col2 ASC NULLS 
FIRST, _col3 ASC NULLS FIRST, _col4 ASC NULLS FIRST
                         output shape: tpath: int
                         partition by: 0
                         raw input shape:

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/ptf_streaming.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/ptf_streaming.q.out 
b/ql/src/test/results/clientpositive/tez/ptf_streaming.q.out
index 57f3334..d8aa492 100644
--- a/ql/src/test/results/clientpositive/tez/ptf_streaming.q.out
+++ b/ql/src/test/results/clientpositive/tez/ptf_streaming.q.out
@@ -63,7 +63,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -89,7 +89,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -268,7 +268,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -294,7 +294,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -436,7 +436,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noopstreaming
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col3: string, _col4: string, _col5: int, _col6: string, _col7: double, 
_col8: string
                         partition by: _col2
                         raw input shape:
@@ -561,7 +561,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: p_name, p_size(DESC)
+                          order by: p_name ASC NULLS FIRST, p_size DESC NULLS 
LAST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int
                           partition by: p_mfgr
                           raw input shape:
@@ -588,7 +588,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col1, _col5(DESC)
+                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -614,7 +614,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1, _col5(DESC)
+                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -733,7 +733,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: p_name
+                          order by: p_name ASC NULLS FIRST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int, p_retailprice: double
                           partition by: p_mfgr
                           raw input shape:
@@ -761,7 +761,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -788,7 +788,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -939,7 +939,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -953,7 +953,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -961,7 +961,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noopstreaming
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -988,7 +988,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -996,7 +996,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1022,7 +1022,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1175,7 +1175,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1189,7 +1189,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1197,7 +1197,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noopstreaming
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1224,7 +1224,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1232,7 +1232,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1258,7 +1258,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1411,7 +1411,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1425,7 +1425,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1433,7 +1433,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1460,7 +1460,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1468,7 +1468,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1494,7 +1494,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1664,7 +1664,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noopstreaming
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col5: int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1709,7 +1709,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1895,14 +1895,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -1916,7 +1916,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -1924,7 +1924,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noopstreaming
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -1951,7 +1951,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -1959,7 +1959,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -1985,7 +1985,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         partition by: _col2, _col1
                         raw input shape:
                         window functions:
@@ -2167,14 +2167,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -2200,7 +2200,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2226,7 +2226,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2
+                        order by: _col2 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -2252,7 +2252,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2427,14 +2427,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2448,7 +2448,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: _col2, _col1
+                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -2476,7 +2476,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col2, _col1
+                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2503,7 +2503,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1
+                        order by: _col1 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/subquery_in.q.out 
b/ql/src/test/results/clientpositive/tez/subquery_in.q.out
index 517e322..cc60c53 100644
--- a/ql/src/test/results/clientpositive/tez/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/tez/subquery_in.q.out
@@ -334,7 +334,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col5
+                        order by: _col5 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -511,7 +511,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col5
+                        order by: _col5 ASC NULLS FIRST
                         partition by: _col2
                         raw input shape:
                         window functions:

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/tez_join_result_complex.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/tez/tez_join_result_complex.q.out 
b/ql/src/test/results/clientpositive/tez/tez_join_result_complex.q.out
index 3d64a9f..58c4c86 100644
--- a/ql/src/test/results/clientpositive/tez/tez_join_result_complex.q.out
+++ b/ql/src/test/results/clientpositive/tez/tez_join_result_complex.q.out
@@ -444,6 +444,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 7501 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 2 Data size: 7501 Basic stats: 
COMPLETE Column stats: NONE
@@ -1664,6 +1665,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 7501 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: string)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 2 Data size: 7501 Basic stats: 
COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/transform_ppr1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/transform_ppr1.q.out 
b/ql/src/test/results/clientpositive/tez/transform_ppr1.q.out
index 3ca5cf2..92d1f4c 100644
--- a/ql/src/test/results/clientpositive/tez/transform_ppr1.q.out
+++ b/ql/src/test/results/clientpositive/tez/transform_ppr1.q.out
@@ -136,6 +136,7 @@ STAGE PLANS:
                         Statistics: Num rows: 333 Data size: 3537 Basic stats: 
COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: _col1 (type: string)
+                          null sort order: a
                           sort order: +
                           Map-reduce partition columns: _col1 (type: string)
                           Statistics: Num rows: 333 Data size: 3537 Basic 
stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/transform_ppr2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/transform_ppr2.q.out 
b/ql/src/test/results/clientpositive/tez/transform_ppr2.q.out
index ebb8a18..c131bbe 100644
--- a/ql/src/test/results/clientpositive/tez/transform_ppr2.q.out
+++ b/ql/src/test/results/clientpositive/tez/transform_ppr2.q.out
@@ -138,6 +138,7 @@ STAGE PLANS:
                         Statistics: Num rows: 333 Data size: 3537 Basic stats: 
COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: _col1 (type: string)
+                          null sort order: a
                           sort order: +
                           Map-reduce partition columns: _col1 (type: string)
                           Statistics: Num rows: 333 Data size: 3537 Basic 
stats: COMPLETE Column stats: NONE

Reply via email to