You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2016/03/02 12:00:18 UTC

[07/18] hive git commit: HIVE-12994: Implement support for NULLS FIRST/NULLS LAST (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_in.q.out b/ql/src/test/results/clientpositive/subquery_in.q.out
index e59e192..58f5618 100644
--- a/ql/src/test/results/clientpositive/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/subquery_in.q.out
@@ -274,7 +274,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:
@@ -458,7 +458,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/subquery_in_having.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_in_having.q.out b/ql/src/test/results/clientpositive/subquery_in_having.q.out
index d27304f..e623299 100644
--- a/ql/src/test/results/clientpositive/subquery_in_having.q.out
+++ b/ql/src/test/results/clientpositive/subquery_in_having.q.out
@@ -1336,7 +1336,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/subquery_notin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_notin.q.out b/ql/src/test/results/clientpositive/subquery_notin.q.out
index f1fceba..c600b7f 100644
--- a/ql/src/test/results/clientpositive/subquery_notin.q.out
+++ b/ql/src/test/results/clientpositive/subquery_notin.q.out
@@ -342,7 +342,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:
@@ -498,7 +498,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:
@@ -626,7 +626,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:
@@ -793,7 +793,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:
@@ -954,7 +954,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:
@@ -1146,7 +1146,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/subquery_unqualcolumnrefs.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out b/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
index 7f70e39..7853737 100644
--- a/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
+++ b/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
@@ -230,7 +230,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:
@@ -402,7 +402,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:
@@ -838,7 +838,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:
@@ -994,7 +994,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/temp_table_display_colstats_tbllvl.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/temp_table_display_colstats_tbllvl.q.out b/ql/src/test/results/clientpositive/temp_table_display_colstats_tbllvl.q.out
index 0762dce..532e65a 100644
--- a/ql/src/test/results/clientpositive/temp_table_display_colstats_tbllvl.q.out
+++ b/ql/src/test/results/clientpositive/temp_table_display_colstats_tbllvl.q.out
@@ -145,6 +145,7 @@ STAGE PLANS:
                 mode: hash
                 outputColumnNames: _col0, _col1, _col2
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   tag: -1
                   value expressions: _col0 (type: struct<columntype:string,maxlength:bigint,sumlength:bigint,count:bigint,countnulls:bigint,bitvector:string,numbitvectors:int>), _col1 (type: struct<columntype:string,min:bigint,max:bigint,countnulls:bigint,bitvector:string,numbitvectors:int>), _col2 (type: struct<columntype:string,min:double,max:double,countnulls:bigint,bitvector:string,numbitvectors:int>)

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_1.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_1.q.out
index c175580..bd6db7f 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_1.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_1.q.out
@@ -170,6 +170,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -257,6 +258,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
@@ -493,6 +495,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
@@ -610,6 +613,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -800,6 +804,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
@@ -917,6 +922,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_11.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_11.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_11.q.out
index e4692b5..04b48a2 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_11.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_11.q.out
@@ -166,6 +166,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -252,6 +253,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
@@ -478,6 +480,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -564,6 +567,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
@@ -785,6 +789,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -867,6 +872,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
@@ -1103,6 +1109,7 @@ STAGE PLANS:
                     Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -1188,6 +1195,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
@@ -1299,6 +1307,7 @@ STAGE PLANS:
                     Statistics: Num rows: 116 Data size: 11624 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: 116 Data size: 11624 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
index a219e59..8664435 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
@@ -232,6 +232,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 114 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: 114 Basic stats: COMPLETE Column stats: NONE
@@ -303,6 +304,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 170 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: 170 Basic stats: COMPLETE Column stats: NONE
@@ -404,6 +406,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
@@ -514,6 +517,7 @@ STAGE PLANS:
                   Select Operator
                     Statistics: Num rows: 1 Data size: 170 Basic stats: PARTIAL Column stats: NONE
                     Reduce Output Operator
+                      null sort order: 
                       sort order: 
                       Statistics: Num rows: 1 Data size: 170 Basic stats: PARTIAL Column stats: NONE
                       tag: 1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_2.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_2.q.out
index 78fe2e9..a0f2be1 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_2.q.out
@@ -166,6 +166,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
@@ -283,6 +284,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 226 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: 226 Basic stats: COMPLETE Column stats: NONE
@@ -475,6 +477,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
@@ -592,6 +595,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 226 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: 226 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_3.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_3.q.out
index c67c816..e6fb5dc 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_3.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_3.q.out
@@ -150,6 +150,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 228 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: 228 Basic stats: COMPLETE Column stats: NONE
@@ -283,6 +284,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
@@ -473,6 +475,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
@@ -544,6 +547,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 228 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: 228 Basic stats: COMPLETE Column stats: NONE
@@ -780,6 +784,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
@@ -851,6 +856,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 228 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: 228 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_4.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_4.q.out
index 33cb0ae..b24c2769 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_4.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_4.q.out
@@ -166,6 +166,7 @@ STAGE PLANS:
                       Statistics: Num rows: 4 Data size: 452 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: 4 Data size: 452 Basic stats: COMPLETE Column stats: NONE
@@ -299,6 +300,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
@@ -489,6 +491,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
@@ -560,6 +563,7 @@ STAGE PLANS:
                       Statistics: Num rows: 4 Data size: 452 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: 4 Data size: 452 Basic stats: COMPLETE Column stats: NONE
@@ -796,6 +800,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
@@ -867,6 +872,7 @@ STAGE PLANS:
                       Statistics: Num rows: 4 Data size: 452 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: 4 Data size: 452 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_5.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_5.q.out
index 7bb05f1..db7b805 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_5.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_5.q.out
@@ -207,6 +207,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
@@ -441,6 +442,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
@@ -621,6 +623,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
@@ -689,6 +692,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 226 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: 226 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_7.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_7.q.out
index dbb6ecb..faf20fa 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_7.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_7.q.out
@@ -183,6 +183,7 @@ STAGE PLANS:
                       Statistics: Num rows: 4 Data size: 452 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: 4 Data size: 452 Basic stats: COMPLETE Column stats: NONE
@@ -316,6 +317,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
@@ -554,6 +556,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
@@ -671,6 +674,7 @@ STAGE PLANS:
                       Statistics: Num rows: 4 Data size: 452 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: 4 Data size: 452 Basic stats: COMPLETE Column stats: NONE
@@ -909,6 +913,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
@@ -1026,6 +1031,7 @@ STAGE PLANS:
                       Statistics: Num rows: 4 Data size: 452 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: 4 Data size: 452 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_8.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_8.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_8.q.out
index 89034de..7b51ffc 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_8.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_8.q.out
@@ -183,6 +183,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 228 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: 228 Basic stats: COMPLETE Column stats: NONE
@@ -316,6 +317,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
@@ -554,6 +556,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
@@ -671,6 +674,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 228 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: 228 Basic stats: COMPLETE Column stats: NONE
@@ -911,6 +915,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
@@ -1028,6 +1033,7 @@ STAGE PLANS:
                       Statistics: Num rows: 2 Data size: 228 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: 228 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/bucket2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/bucket2.q.out b/ql/src/test/results/clientpositive/tez/bucket2.q.out
index 952fe13..151b0ce 100644
--- a/ql/src/test/results/clientpositive/tez/bucket2.q.out
+++ b/ql/src/test/results/clientpositive/tez/bucket2.q.out
@@ -60,6 +60,7 @@ STAGE PLANS:
                     outputColumnNames: _col0, _col1
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
+                      null sort order: 
                       sort order: 
                       Map-reduce partition columns: UDFToInteger(_col0) (type: int)
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/bucket3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/bucket3.q.out b/ql/src/test/results/clientpositive/tez/bucket3.q.out
index b63ebbd..3308a8a 100644
--- a/ql/src/test/results/clientpositive/tez/bucket3.q.out
+++ b/ql/src/test/results/clientpositive/tez/bucket3.q.out
@@ -64,6 +64,7 @@ STAGE PLANS:
                     outputColumnNames: _col0, _col1
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
+                      null sort order: 
                       sort order: 
                       Map-reduce partition columns: UDFToInteger(_col0) (type: int)
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/bucket4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/bucket4.q.out b/ql/src/test/results/clientpositive/tez/bucket4.q.out
index 5f4c2e9..f2030e8 100644
--- a/ql/src/test/results/clientpositive/tez/bucket4.q.out
+++ b/ql/src/test/results/clientpositive/tez/bucket4.q.out
@@ -57,6 +57,7 @@ STAGE PLANS:
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: UDFToInteger(_col0) (type: int)
+                      null sort order: a
                       sort order: +
                       Map-reduce partition columns: UDFToInteger(_col0) (type: int)
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/ctas.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/ctas.q.out b/ql/src/test/results/clientpositive/tez/ctas.q.out
index 74e8b98..0259c02 100644
--- a/ql/src/test/results/clientpositive/tez/ctas.q.out
+++ b/ql/src/test/results/clientpositive/tez/ctas.q.out
@@ -722,11 +722,13 @@ TOK_CREATETABLE
                   value
          TOK_SORTBY
             TOK_TABSORTCOLNAMEASC
-               TOK_TABLE_OR_COL
-                  key
+               TOK_NULLS_FIRST
+                  TOK_TABLE_OR_COL
+                     key
             TOK_TABSORTCOLNAMEASC
-               TOK_TABLE_OR_COL
-                  value
+               TOK_NULLS_FIRST
+                  TOK_TABLE_OR_COL
+                     value
          TOK_LIMIT
             10
 
@@ -759,6 +761,7 @@ STAGE PLANS:
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col0 (type: string), _col1 (type: string)
+                      null sort order: aa
                       sort order: ++
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                       tag: -1
@@ -826,6 +829,7 @@ STAGE PLANS:
                   Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
                     key expressions: _col0 (type: string), _col1 (type: string)
+                    null sort order: aa
                     sort order: ++
                     Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
                     tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/disable_merge_for_bucketing.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/disable_merge_for_bucketing.q.out b/ql/src/test/results/clientpositive/tez/disable_merge_for_bucketing.q.out
index 7b59dea..65f750b 100644
--- a/ql/src/test/results/clientpositive/tez/disable_merge_for_bucketing.q.out
+++ b/ql/src/test/results/clientpositive/tez/disable_merge_for_bucketing.q.out
@@ -56,6 +56,7 @@ STAGE PLANS:
                     outputColumnNames: _col0, _col1
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Reduce Output Operator
+                      null sort order: 
                       sort order: 
                       Map-reduce partition columns: UDFToInteger(_col0) (type: int)
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/dynpart_sort_opt_vectorization.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/dynpart_sort_opt_vectorization.q.out b/ql/src/test/results/clientpositive/tez/dynpart_sort_opt_vectorization.q.out
index a90e3f6..f7a94ac 100644
--- a/ql/src/test/results/clientpositive/tez/dynpart_sort_opt_vectorization.q.out
+++ b/ql/src/test/results/clientpositive/tez/dynpart_sort_opt_vectorization.q.out
@@ -1215,7 +1215,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	4                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: desc formatted over1k_part_buck_sort_orc partition(t="__HIVE_DEFAULT_PARTITION__")
@@ -1256,7 +1256,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	4                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: select count(*) from over1k_part_orc
@@ -2255,7 +2255,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: desc formatted over1k_part_buck_sort2_orc partition(t="__HIVE_DEFAULT_PARTITION__")
@@ -2296,7 +2296,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: explain select * from over1k_part_buck_sort2_orc
@@ -2471,7 +2471,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: desc formatted over1k_part_buck_sort2_orc partition(t="__HIVE_DEFAULT_PARTITION__")
@@ -2512,7 +2512,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: explain select * from over1k_part_buck_sort2_orc

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/dynpart_sort_optimization.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/dynpart_sort_optimization.q.out b/ql/src/test/results/clientpositive/tez/dynpart_sort_optimization.q.out
index 5292106..01dc4ae 100644
--- a/ql/src/test/results/clientpositive/tez/dynpart_sort_optimization.q.out
+++ b/ql/src/test/results/clientpositive/tez/dynpart_sort_optimization.q.out
@@ -1128,7 +1128,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	4                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: desc formatted over1k_part_buck_sort partition(t="__HIVE_DEFAULT_PARTITION__")
@@ -1169,7 +1169,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	4                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: select count(*) from over1k_part
@@ -2152,7 +2152,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: desc formatted over1k_part_buck_sort2 partition(t="__HIVE_DEFAULT_PARTITION__")
@@ -2193,7 +2193,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: select * from over1k_part_buck_sort2
@@ -2295,7 +2295,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: desc formatted over1k_part_buck_sort2 partition(t="__HIVE_DEFAULT_PARTITION__")
@@ -2336,7 +2336,7 @@ OutputFormat:       	org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 Compressed:         	No                  	 
 Num Buckets:        	1                   	 
 Bucket Columns:     	[si]                	 
-Sort Columns:       	[Order(col:f, order:1)]	 
+Sort Columns:       	[Order(col:f, order:1, nullOrder:0)]	 
 Storage Desc Params:	 	 
 	serialization.format	1                   
 PREHOOK: query: select * from over1k_part_buck_sort2

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/explainuser_1.q.out b/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
index 9942b8c..70a1322 100644
--- a/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
+++ b/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
@@ -2302,7 +2302,7 @@ Stage-0
                 Filter Operator [FIL_25] (rows=26 width=491)
                   predicate:first_value_window_0 is not null
                   PTF Operator [PTF_10] (rows=26 width=491)
-                    Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col5","partition by:":"_col2"}]
+                    Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col5 ASC NULLS FIRST","partition by:":"_col2"}]
                     Select Operator [SEL_9] (rows=26 width=491)
                       Output:["_col1","_col2","_col5"]
                     <-Map 4 [SIMPLE_EDGE]
@@ -2671,7 +2671,7 @@ Stage-0
         Select Operator [SEL_4] (rows=20 width=52)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           PTF Operator [PTF_3] (rows=20 width=459)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"0","partition by:":"0"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"0 ASC NULLS FIRST","partition by:":"0"}]
             Select Operator [SEL_2] (rows=20 width=459)
               Output:["_col2","_col3"]
             <-Map 1 [SIMPLE_EDGE]
@@ -2698,7 +2698,7 @@ Stage-0
         Select Operator [SEL_4] (rows=20 width=52)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
           PTF Operator [PTF_3] (rows=20 width=459)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"0","partition by:":"0"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"0 ASC NULLS FIRST","partition by:":"0"}]
             Select Operator [SEL_2] (rows=20 width=459)
               Output:["_col2","_col3"]
             <-Map 1 [SIMPLE_EDGE]
@@ -2725,7 +2725,7 @@ Stage-0
         Select Operator [SEL_4] (rows=20 width=64)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10"]
           PTF Operator [PTF_3] (rows=20 width=612)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col0"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col0"}]
             Select Operator [SEL_2] (rows=20 width=612)
               Output:["_col0","_col1","_col2","_col3"]
             <-Map 1 [SIMPLE_EDGE]
@@ -2752,7 +2752,7 @@ Stage-0
         Select Operator [SEL_4] (rows=25 width=179)
           Output:["_col0","_col1","_col2"]
           PTF Operator [PTF_3] (rows=25 width=443)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col0"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col0"}]
             Select Operator [SEL_2] (rows=25 width=443)
               Output:["_col0","_col1"]
             <-Map 1 [SIMPLE_EDGE]
@@ -4326,14 +4326,14 @@ Stage-0
         Select Operator [SEL_7] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_6] (rows=26 width=499)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_5] (rows=26 width=499)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_4]
                 PartitionCols:_col2
                 PTF Operator [PTF_3] (rows=26 width=499)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_2] (rows=26 width=499)
                     Output:["_col1","_col2","_col5","_col7"]
                   <-Map 1 [SIMPLE_EDGE]
@@ -4372,14 +4372,14 @@ Stage-0
         Select Operator [SEL_14] (rows=29 width=227)
           Output:["_col0","_col1","_col2","_col3"]
           PTF Operator [PTF_13] (rows=29 width=223)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_12] (rows=29 width=223)
               Output:["_col1","_col2","_col5"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_11]
                 PartitionCols:_col2
                 PTF Operator [PTF_10] (rows=29 width=223)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_9] (rows=29 width=223)
                     Output:["_col1","_col2","_col5"]
                   <-Map 1 [SIMPLE_EDGE]
@@ -4434,14 +4434,14 @@ Stage-0
         Select Operator [SEL_7] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_6] (rows=26 width=499)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_5] (rows=26 width=499)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_4]
                 PartitionCols:_col2
                 PTF Operator [PTF_3] (rows=26 width=499)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_2] (rows=26 width=499)
                     Output:["_col1","_col2","_col5","_col7"]
                   <-Map 1 [SIMPLE_EDGE]
@@ -4485,14 +4485,14 @@ Stage-0
         Select Operator [SEL_7] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
           PTF Operator [PTF_6] (rows=26 width=491)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_5] (rows=26 width=491)
               Output:["_col1","_col2","_col5"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_4]
                 PartitionCols:_col2
                 PTF Operator [PTF_3] (rows=26 width=491)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_2] (rows=26 width=491)
                     Output:["_col1","_col2","_col5"]
                   <-Map 1 [SIMPLE_EDGE]
@@ -4539,7 +4539,7 @@ Stage-0
         Select Operator [SEL_12] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
           PTF Operator [PTF_11] (rows=26 width=223)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col0"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col0"}]
             Group By Operator [GBY_8] (rows=26 width=223)
               Output:["_col0","_col1","_col2"],keys:KEY._col0, KEY._col1, KEY._col2
             <-Reducer 3 [SIMPLE_EDGE]
@@ -4553,7 +4553,7 @@ Stage-0
                     Select Operator [SEL_4] (rows=26 width=491)
                       Output:["_col1","_col2","_col5"]
                       PTF Operator [PTF_3] (rows=26 width=491)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                         Select Operator [SEL_2] (rows=26 width=491)
                           Output:["_col1","_col2","_col5"]
                         <-Map 1 [SIMPLE_EDGE]
@@ -4599,7 +4599,7 @@ Stage-0
         <-Filter Operator [FIL_14] (rows=26 width=887)
             predicate:_col0 is not null
             PTF Operator [PTF_4] (rows=26 width=887)
-              Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+              Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
               Select Operator [SEL_3] (rows=26 width=887)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
               <-Map 1 [SIMPLE_EDGE]
@@ -4637,21 +4637,21 @@ Stage-0
         Select Operator [SEL_8] (rows=26 width=227)
           Output:["_col0","_col1","_col2","_col3"]
           PTF Operator [PTF_7] (rows=26 width=491)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1, _col5(DESC)","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST, _col5 DESC NULLS LAST","partition by:":"_col2"}]
             Select Operator [SEL_6] (rows=26 width=491)
               Output:["_col1","_col2","_col5"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_5]
                 PartitionCols:_col2
                 PTF Operator [PTF_4] (rows=26 width=491)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col1, _col5(DESC)","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col1 ASC NULLS FIRST, _col5 DESC NULLS LAST","partition by:":"_col2"}}]
                   Select Operator [SEL_3] (rows=26 width=491)
                     Output:["_col1","_col2","_col5"]
                   <-Map 1 [SIMPLE_EDGE]
                     SHUFFLE [RS_2]
                       PartitionCols:p_mfgr
                       PTF Operator [PTF_1] (rows=26 width=223)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"p_name, p_size(DESC)","partition by:":"p_mfgr"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"p_name ASC NULLS FIRST, p_size DESC NULLS LAST","partition by:":"p_mfgr"}}]
                         TableScan [TS_0] (rows=26 width=223)
                           default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
 
@@ -4688,21 +4688,21 @@ Stage-0
         Select Operator [SEL_8] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_7] (rows=26 width=499)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_6] (rows=26 width=499)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_5]
                 PartitionCols:_col2
                 PTF Operator [PTF_4] (rows=26 width=499)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_3] (rows=26 width=499)
                     Output:["_col1","_col2","_col5","_col7"]
                   <-Map 1 [SIMPLE_EDGE]
                     SHUFFLE [RS_2]
                       PartitionCols:p_mfgr
                       PTF Operator [PTF_1] (rows=26 width=231)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"p_name","partition by:":"p_mfgr"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"p_name ASC NULLS FIRST","partition by:":"p_mfgr"}}]
                         TableScan [TS_0] (rows=26 width=231)
                           default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size","p_retailprice"]
 
@@ -4739,14 +4739,14 @@ Stage-0
         Select Operator [SEL_7] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_6] (rows=26 width=499)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_5] (rows=26 width=499)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_4]
                 PartitionCols:_col2
                 PTF Operator [PTF_3] (rows=26 width=499)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_2] (rows=26 width=499)
                     Output:["_col1","_col2","_col5","_col7"]
                   <-Map 1 [SIMPLE_EDGE]
@@ -4791,23 +4791,23 @@ Stage-0
         Select Operator [SEL_11] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_10] (rows=26 width=499)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_9] (rows=26 width=499)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 3 [SIMPLE_EDGE]
               SHUFFLE [RS_8]
                 PartitionCols:_col2
                 PTF Operator [PTF_7] (rows=26 width=499)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2(DESC), _col1","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2(DESC), _col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2 DESC NULLS LAST, _col1 ASC NULLS FIRST","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 DESC NULLS LAST, _col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_6] (rows=26 width=499)
                     Output:["_col1","_col2","_col5","_col7"]
                   <-Reducer 2 [SIMPLE_EDGE]
                     SHUFFLE [RS_5]
                       PartitionCols:_col2
                       PTF Operator [PTF_4] (rows=26 width=499)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2(DESC), _col1","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2(DESC), _col1","partition by:":"_col2"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2 DESC NULLS LAST, _col1 ASC NULLS FIRST","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 DESC NULLS LAST, _col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                         PTF Operator [PTF_3] (rows=26 width=499)
-                          Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2(DESC), _col1","partition by:":"_col2"}}]
+                          Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 DESC NULLS LAST, _col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                           Select Operator [SEL_2] (rows=26 width=499)
                             Output:["_col1","_col2","_col5","_col7"]
                           <-Map 1 [SIMPLE_EDGE]
@@ -4857,14 +4857,14 @@ Stage-0
         Select Operator [SEL_7] (rows=26 width=235)
           Output:["_col0","_col1","_col2","_col3"]
           PTF Operator [PTF_6] (rows=26 width=499)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_5] (rows=26 width=499)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 2 [SIMPLE_EDGE]
               SHUFFLE [RS_4]
                 PartitionCols:_col2
                 PTF Operator [PTF_3] (rows=26 width=499)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_2] (rows=26 width=499)
                     Output:["_col1","_col2","_col5","_col7"]
                   <-Map 1 [SIMPLE_EDGE]
@@ -4912,7 +4912,7 @@ Stage-0
         Select Operator [SEL_13] (rows=29 width=259)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
           PTF Operator [PTF_12] (rows=29 width=767)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_11] (rows=29 width=767)
               Output:["_col1","_col2","_col5","_col7"]
             <-Reducer 2 [SIMPLE_EDGE]
@@ -4930,7 +4930,7 @@ Stage-0
                 <-Filter Operator [FIL_18] (rows=26 width=503)
                     predicate:_col0 is not null
                     PTF Operator [PTF_4] (rows=26 width=503)
-                      Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                      Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                       Select Operator [SEL_3] (rows=26 width=503)
                         Output:["_col0","_col1","_col2","_col5","_col7"]
                       <-Map 1 [SIMPLE_EDGE]
@@ -5058,14 +5058,14 @@ Stage-4
                 Select Operator [SEL_7] (rows=26 width=239)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                   PTF Operator [PTF_6] (rows=26 width=499)
-                    Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+                    Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
                     Select Operator [SEL_5] (rows=26 width=499)
                       Output:["_col1","_col2","_col5","_col7"]
                     <-Reducer 2 [SIMPLE_EDGE]
                       SHUFFLE [RS_4]
                         PartitionCols:_col2
                         PTF Operator [PTF_3] (rows=26 width=499)
-                          Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1","partition by:":"_col2"}}]
+                          Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}}]
                           Select Operator [SEL_2] (rows=26 width=499)
                             Output:["_col1","_col2","_col5","_col7"]
                           <-Map 1 [SIMPLE_EDGE]
@@ -5079,7 +5079,7 @@ Stage-4
                 Select Operator [SEL_17] (rows=26 width=247)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                   PTF Operator [PTF_16] (rows=26 width=499)
-                    Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3, _col2","partition by:":"_col3"}]
+                    Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS FIRST, _col2 ASC NULLS FIRST","partition by:":"_col3"}]
                     Select Operator [SEL_15] (rows=26 width=499)
                       Output:["_col0","_col2","_col3","_col6"]
                     <-Reducer 4 [SIMPLE_EDGE]
@@ -5088,7 +5088,7 @@ Stage-4
                         Select Operator [SEL_13] (rows=26 width=491)
                           Output:["_col1","_col2","_col5","sum_window_0"]
                           PTF Operator [PTF_12] (rows=26 width=491)
-                            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col5","partition by:":"_col2"}]
+                            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col5 ASC NULLS FIRST","partition by:":"_col2"}]
                             Select Operator [SEL_11] (rows=26 width=491)
                               Output:["_col1","_col2","_col5"]
                             <-Reducer 2 [SIMPLE_EDGE]
@@ -5152,23 +5152,23 @@ Stage-0
         Select Operator [SEL_11] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_10] (rows=26 width=491)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2, _col1","partition by:":"_col2, _col1"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}]
             Select Operator [SEL_9] (rows=26 width=491)
               Output:["_col1","_col2","_col5"]
             <-Reducer 3 [SIMPLE_EDGE]
               SHUFFLE [RS_8]
                 PartitionCols:_col2, _col1
                 PTF Operator [PTF_7] (rows=26 width=491)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2, _col1","partition by:":"_col2, _col1"}},{"Partition table definition":{"name:":"noop","order by:":"_col2, _col1","partition by:":"_col2, _col1"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}}]
                   Select Operator [SEL_6] (rows=26 width=491)
                     Output:["_col1","_col2","_col5"]
                   <-Reducer 2 [SIMPLE_EDGE]
                     SHUFFLE [RS_5]
                       PartitionCols:_col2, _col1
                       PTF Operator [PTF_4] (rows=26 width=491)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2, _col1","partition by:":"_col2, _col1"}},{"Partition table definition":{"name:":"noop","order by:":"_col2, _col1","partition by:":"_col2, _col1"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noopwithmap","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}}]
                         PTF Operator [PTF_3] (rows=26 width=491)
-                          Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}}]
+                          Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}}]
                           Select Operator [SEL_2] (rows=26 width=491)
                             Output:["_col1","_col2","_col5"]
                           <-Map 1 [SIMPLE_EDGE]
@@ -5228,28 +5228,28 @@ Stage-0
         Select Operator [SEL_13] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_12] (rows=26 width=491)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_11] (rows=26 width=491)
               Output:["_col1","_col2","_col5"]
             <-Reducer 4 [SIMPLE_EDGE]
               SHUFFLE [RS_10]
                 PartitionCols:_col2
                 PTF Operator [PTF_9] (rows=26 width=491)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_8] (rows=26 width=491)
                     Output:["_col1","_col2","_col5"]
                   <-Reducer 3 [SIMPLE_EDGE]
                     SHUFFLE [RS_7]
                       PartitionCols:_col2
                       PTF Operator [PTF_6] (rows=26 width=491)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2, _col1","partition by:":"_col2, _col1"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}}]
                         Select Operator [SEL_5] (rows=26 width=491)
                           Output:["_col1","_col2","_col5"]
                         <-Reducer 2 [SIMPLE_EDGE]
                           SHUFFLE [RS_4]
                             PartitionCols:_col2, _col1
                             PTF Operator [PTF_3] (rows=26 width=491)
-                              Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}}]
+                              Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}}]
                               Select Operator [SEL_2] (rows=26 width=491)
                                 Output:["_col1","_col2","_col5"]
                               <-Map 1 [SIMPLE_EDGE]
@@ -5304,21 +5304,21 @@ Stage-0
         Select Operator [SEL_10] (rows=26 width=239)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
           PTF Operator [PTF_9] (rows=26 width=491)
-            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1","partition by:":"_col2"}]
+            Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST","partition by:":"_col2"}]
             Select Operator [SEL_8] (rows=26 width=491)
               Output:["_col1","_col2","_col5"]
             <-Reducer 3 [SIMPLE_EDGE]
               SHUFFLE [RS_7]
                 PartitionCols:_col2
                 PTF Operator [PTF_6] (rows=26 width=491)
-                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2","partition by:":"_col2"}}]
+                  Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST","partition by:":"_col2"}}]
                   Select Operator [SEL_5] (rows=26 width=491)
                     Output:["_col1","_col2","_col5"]
                   <-Reducer 2 [SIMPLE_EDGE]
                     SHUFFLE [RS_4]
                       PartitionCols:_col2
                       PTF Operator [PTF_3] (rows=26 width=491)
-                        Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2, _col1","partition by:":"_col2, _col1"}},{"Partition table definition":{"name:":"noop","order by:":"_col2, _col1","partition by:":"_col2, _col1"}}]
+                        Function definitions:[{},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}},{"Partition table definition":{"name:":"noop","order by:":"_col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST","partition by:":"_col2, _col1"}}]
                         Select Operator [SEL_2] (rows=26 width=491)
                           Output:["_col1","_col2","_col5"]
                         <-Map 1 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/filter_join_breaktask.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/filter_join_breaktask.q.out b/ql/src/test/results/clientpositive/tez/filter_join_breaktask.q.out
index 83c4734..15cad97 100644
--- a/ql/src/test/results/clientpositive/tez/filter_join_breaktask.q.out
+++ b/ql/src/test/results/clientpositive/tez/filter_join_breaktask.q.out
@@ -163,6 +163,7 @@ STAGE PLANS:
                       Statistics: Num rows: 25 Data size: 211 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 25 Data size: 211 Basic stats: COMPLETE Column stats: NONE
@@ -234,6 +235,7 @@ STAGE PLANS:
                       Statistics: Num rows: 25 Data size: 211 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int)
+                        null sort order: a
                         sort order: +
                         Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 25 Data size: 211 Basic stats: COMPLETE Column stats: NONE
@@ -306,6 +308,7 @@ STAGE PLANS:
                       Statistics: Num rows: 25 Data size: 211 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: 25 Data size: 211 Basic stats: COMPLETE Column stats: NONE
@@ -375,6 +378,7 @@ STAGE PLANS:
                 Statistics: Num rows: 27 Data size: 232 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col3 (type: string)
+                  null sort order: a
                   sort order: +
                   Map-reduce partition columns: _col3 (type: string)
                   Statistics: Num rows: 27 Data size: 232 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out b/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
index efe4ebf..d03b1cc 100644
--- a/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
@@ -337,6 +337,7 @@ STAGE PLANS:
                       Statistics: Num rows: 25 Data size: 191 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: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
@@ -407,6 +408,7 @@ STAGE PLANS:
                       Statistics: Num rows: 500 Data size: 5312 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: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE