http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/ptf.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ptf.q.out 
b/ql/src/test/results/clientpositive/spark/ptf.q.out
index 91f11bb..4ff8c06 100644
--- a/ql/src/test/results/clientpositive/spark/ptf.q.out
+++ b/ql/src/test/results/clientpositive/spark/ptf.q.out
@@ -57,7 +57,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -83,7 +83,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -261,7 +261,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -287,7 +287,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -411,7 +411,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -533,7 +533,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -559,7 +559,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -709,7 +709,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -735,7 +735,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -888,7 +888,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -923,7 +923,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col0
                         raw input shape:
                         window functions:
@@ -1083,7 +1083,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         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:
@@ -1253,7 +1253,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         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:
@@ -1358,7 +1358,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: p_name ASC NULLS FIRST, p_size DESC NULLS 
LAST
+                          order by: p_name ASC NULLS LAST, p_size DESC NULLS 
LAST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int
                           partition by: p_mfgr
                           raw input shape:
@@ -1385,7 +1385,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
+                        order by: _col1 ASC NULLS LAST, _col5 DESC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -1411,7 +1411,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
+                        order by: _col1 ASC NULLS LAST, _col5 DESC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1527,7 +1527,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: p_name ASC NULLS FIRST
+                          order by: p_name ASC NULLS LAST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int, p_retailprice: double
                           partition by: p_mfgr
                           raw input shape:
@@ -1555,7 +1555,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1582,7 +1582,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1728,7 +1728,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1754,7 +1754,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1903,7 +1903,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS FIRST
+                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1917,7 +1917,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 DESC NULLS LAST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 DESC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1925,7 +1925,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2 DESC NULLS LAST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 DESC NULLS LAST, _col1 ASC NULLS LAST
                           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_1
                         name: noopwithmap
-                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS FIRST
+                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1960,7 +1960,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS FIRST
+                        order by: _col2 DESC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1986,7 +1986,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2142,7 +2142,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -2168,7 +2168,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2335,7 +2335,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col5: int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -2380,7 +2380,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2541,7 +2541,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -2713,7 +2713,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noop
-                          order by: _col0 ASC NULLS FIRST
+                          order by: _col0 ASC NULLS LAST
                           output shape: _col0: string, _col1: string, _col2: 
double
                           partition by: _col0
                           raw input shape:
@@ -2739,7 +2739,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col0
                         raw input shape:
                         window functions:
@@ -2925,7 +2925,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2977,7 +2977,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col5 ASC NULLS FIRST
+                        order by: _col5 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -3013,7 +3013,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col3 ASC NULLS FIRST, _col2 ASC NULLS FIRST
+                        order by: _col3 ASC NULLS LAST, _col2 ASC NULLS LAST
                         partition by: _col3
                         raw input shape:
                         window functions:
@@ -3071,7 +3071,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                   Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
@@ -3095,7 +3095,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                   Statistics: Num rows: 26 Data size: 3147 Basic stats: 
COMPLETE Column stats: NONE
@@ -3326,14 +3326,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         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 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3347,7 +3347,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -3355,7 +3355,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -3382,7 +3382,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3390,7 +3390,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3596,14 +3596,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         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 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3629,7 +3629,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3655,7 +3655,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3681,7 +3681,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -3856,14 +3856,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         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 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -3889,14 +3889,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         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 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -3923,7 +3923,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -4099,14 +4099,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         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 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4132,7 +4132,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -4146,7 +4146,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -4174,7 +4174,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4378,7 +4378,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4392,7 +4392,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 ASC NULLS FIRST
+                          order by: _col2 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2
                           raw input shape:
@@ -4400,7 +4400,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2 ASC NULLS FIRST
+                          order by: _col2 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2
                           raw input shape:
@@ -4427,7 +4427,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -4435,7 +4435,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -4461,7 +4461,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         partition by: _col2, _col1
                         raw input shape:
                         window functions:
@@ -4632,14 +4632,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         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 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4653,7 +4653,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -4681,7 +4681,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -4709,7 +4709,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/ptf_matchpath.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ptf_matchpath.q.out 
b/ql/src/test/results/clientpositive/spark/ptf_matchpath.q.out
index 57b04b2..9e4daa3 100644
--- a/ql/src/test/results/clientpositive/spark/ptf_matchpath.q.out
+++ b/ql/src/test/results/clientpositive/spark/ptf_matchpath.q.out
@@ -94,7 +94,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 ASC NULLS FIRST, _col3 ASC NULLS 
FIRST, _col4 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col3 ASC NULLS LAST, 
_col4 ASC NULLS LAST
                         output shape: tpath: int
                         partition by: _col6
                         raw input shape:
@@ -218,7 +218,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 ASC NULLS FIRST, _col2 ASC NULLS 
FIRST, _col3 ASC NULLS FIRST, _col4 ASC NULLS FIRST
+                        order by: _col6 ASC NULLS LAST, _col2 ASC NULLS LAST, 
_col3 ASC NULLS LAST, _col4 ASC NULLS LAST
                         output shape: tpath: int
                         partition by: 0
                         raw input shape:
@@ -339,7 +339,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 ASC NULLS FIRST, _col2 ASC NULLS 
FIRST, _col3 ASC NULLS FIRST, _col4 ASC NULLS FIRST
+                        order by: _col6 ASC NULLS LAST, _col2 ASC NULLS LAST, 
_col3 ASC NULLS LAST, _col4 ASC NULLS LAST
                         output shape: tpath: int
                         partition by: 0
                         raw input shape:

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out 
b/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out
index cf36bb1..940e744 100644
--- a/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out
+++ b/ql/src/test/results/clientpositive/spark/ptf_streaming.q.out
@@ -56,7 +56,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -82,7 +82,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -258,7 +258,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -284,7 +284,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -423,7 +423,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noopstreaming
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         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:
@@ -545,7 +545,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: p_name ASC NULLS FIRST, p_size DESC NULLS 
LAST
+                          order by: p_name ASC NULLS LAST, p_size DESC NULLS 
LAST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int
                           partition by: p_mfgr
                           raw input shape:
@@ -572,7 +572,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
+                        order by: _col1 ASC NULLS LAST, _col5 DESC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -598,7 +598,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST, _col5 DESC NULLS LAST
+                        order by: _col1 ASC NULLS LAST, _col5 DESC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -714,7 +714,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: p_name ASC NULLS FIRST
+                          order by: p_name ASC NULLS LAST
                           output shape: p_name: string, p_mfgr: string, 
p_size: int, p_retailprice: double
                           partition by: p_mfgr
                           raw input shape:
@@ -742,7 +742,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -769,7 +769,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -917,7 +917,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -931,7 +931,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -939,7 +939,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noopstreaming
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -966,7 +966,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -974,7 +974,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1000,7 +1000,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1150,7 +1150,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1164,7 +1164,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1172,7 +1172,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noopstreaming
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1199,7 +1199,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1207,7 +1207,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1233,7 +1233,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1383,7 +1383,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1397,7 +1397,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1405,7 +1405,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noop
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                           partition by: _col2
                           raw input shape:
@@ -1432,7 +1432,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1440,7 +1440,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noop
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: 
int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1466,7 +1466,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1633,7 +1633,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: abc
                         name: noopstreaming
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         output shape: _col0: int, _col1: string, _col2: 
string, _col5: int, _col7: double
                         partition by: _col2
                         raw input shape:
@@ -1678,7 +1678,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -1861,14 +1861,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         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 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -1882,7 +1882,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmap
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -1890,7 +1890,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_2
                           name: noopstreaming
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -1917,7 +1917,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmap
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -1925,7 +1925,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_2
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2130,14 +2130,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         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 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -2163,7 +2163,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2189,7 +2189,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noop
-                        order by: _col2 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2
                         raw input shape:
@@ -2215,7 +2215,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:
@@ -2387,14 +2387,14 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         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 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2408,7 +2408,7 @@ STAGE PLANS:
                         Partition table definition
                           input alias: ptf_1
                           name: noopwithmapstreaming
-                          order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS 
FIRST
+                          order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                           output shape: _col1: string, _col2: string, _col5: 
int
                           partition by: _col2, _col1
                           raw input shape:
@@ -2436,7 +2436,7 @@ STAGE PLANS:
                       Partition table definition
                         input alias: ptf_1
                         name: noopwithmapstreaming
-                        order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST
+                        order by: _col2 ASC NULLS LAST, _col1 ASC NULLS LAST
                         output shape: _col1: string, _col2: string, _col5: int
                         partition by: _col2, _col1
                         raw input shape:
@@ -2463,7 +2463,7 @@ STAGE PLANS:
                       Windowing table definition
                         input alias: ptf_1
                         name: windowingtablefunction
-                        order by: _col1 ASC NULLS FIRST
+                        order by: _col1 ASC NULLS LAST
                         partition by: _col2
                         raw input shape:
                         window functions:

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/sample6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/sample6.q.out 
b/ql/src/test/results/clientpositive/spark/sample6.q.out
index 153f0fd..f710ea4 100644
--- a/ql/src/test/results/clientpositive/spark/sample6.q.out
+++ b/ql/src/test/results/clientpositive/spark/sample6.q.out
@@ -488,7 +488,7 @@ STAGE PLANS:
                       Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -902,7 +902,7 @@ STAGE PLANS:
                       Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -1539,7 +1539,7 @@ STAGE PLANS:
                       Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -2058,7 +2058,7 @@ STAGE PLANS:
                       Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 500 Data size: 5301 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -2517,7 +2517,7 @@ STAGE PLANS:
                       Statistics: Num rows: 250 Data size: 2656 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 250 Data size: 2656 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -2902,7 +2902,7 @@ STAGE PLANS:
                       Statistics: Num rows: 250 Data size: 2656 Basic stats: 
COMPLETE Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 250 Data size: 2656 Basic stats: 
COMPLETE Column stats: NONE
                         tag: -1
@@ -3178,7 +3178,7 @@ STAGE PLANS:
                       Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       Reduce Output Operator
                         key expressions: _col0 (type: int), _col1 (type: 
string)
-                        null sort order: aa
+                        null sort order: zz
                         sort order: ++
                         Statistics: Num rows: 1 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                         tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/skewjoin_union_remove_1.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/spark/skewjoin_union_remove_1.q.out 
b/ql/src/test/results/clientpositive/spark/skewjoin_union_remove_1.q.out
index 9cf9bc5..0da9583 100644
--- a/ql/src/test/results/clientpositive/spark/skewjoin_union_remove_1.q.out
+++ b/ql/src/test/results/clientpositive/spark/skewjoin_union_remove_1.q.out
@@ -322,14 +322,14 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@t1_n57
 POSTHOOK: Input: default@t2_n35
 #### A masked pattern was here ####
-NULL   NULL    4       14
-NULL   NULL    5       15
 2      12      2       22
 3      13      3       13
 8      18      8       18
 8      18      8       18
 8      28      8       18
 8      28      8       18
+NULL   NULL    4       14
+NULL   NULL    5       15
 PREHOOK: query: create table DEST1_n58(key1 STRING, val1 STRING, key2 STRING, 
val2 STRING)
 PREHOOK: type: CREATETABLE
 PREHOOK: Output: database:default
@@ -670,11 +670,11 @@ ORDER BY key1, key2, val1, val2
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1_n58
 #### A masked pattern was here ####
-NULL   NULL    4       14
-NULL   NULL    5       15
 2      12      2       22
 3      13      3       13
 8      18      8       18
 8      18      8       18
 8      28      8       18
 8      28      8       18
+NULL   NULL    4       14
+NULL   NULL    5       15

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/skewjoinopt1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/skewjoinopt1.q.out 
b/ql/src/test/results/clientpositive/spark/skewjoinopt1.q.out
index 2996403..409b0ef 100644
--- a/ql/src/test/results/clientpositive/spark/skewjoinopt1.q.out
+++ b/ql/src/test/results/clientpositive/spark/skewjoinopt1.q.out
@@ -322,14 +322,14 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@t1_n101
 POSTHOOK: Input: default@t2_n64
 #### A masked pattern was here ####
-NULL   NULL    4       14
-NULL   NULL    5       15
 2      12      2       22
 3      13      3       13
 8      18      8       18
 8      18      8       18
 8      28      8       18
 8      28      8       18
+NULL   NULL    4       14
+NULL   NULL    5       15
 PREHOOK: query: EXPLAIN
 SELECT count(1) FROM T1_n101 a JOIN T2_n64 b ON a.key = b.key
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/skewjoinopt15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/skewjoinopt15.q.out 
b/ql/src/test/results/clientpositive/spark/skewjoinopt15.q.out
index a90de1c..3cc9d19 100644
--- a/ql/src/test/results/clientpositive/spark/skewjoinopt15.q.out
+++ b/ql/src/test/results/clientpositive/spark/skewjoinopt15.q.out
@@ -354,14 +354,14 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@t1_n109
 POSTHOOK: Input: default@t2_n66
 #### A masked pattern was here ####
-NULL   NULL    4       14
-NULL   NULL    5       15
 2      12      2       22
 3      13      3       13
 8      18      8       18
 8      18      8       18
 8      28      8       18
 8      28      8       18
+NULL   NULL    4       14
+NULL   NULL    5       15
 PREHOOK: query: EXPLAIN
 SELECT count(1) FROM T1_n109 a JOIN T2_n66 b ON a.key = b.key
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/skewjoinopt3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/skewjoinopt3.q.out 
b/ql/src/test/results/clientpositive/spark/skewjoinopt3.q.out
index f0059cb..8bdca38 100644
--- a/ql/src/test/results/clientpositive/spark/skewjoinopt3.q.out
+++ b/ql/src/test/results/clientpositive/spark/skewjoinopt3.q.out
@@ -322,8 +322,6 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@t1_n12
 POSTHOOK: Input: default@t2_n7
 #### A masked pattern was here ####
-NULL   NULL    4       14
-NULL   NULL    5       15
 1      11      NULL    NULL
 2      12      2       22
 3      13      3       13
@@ -332,3 +330,5 @@ NULL        NULL    5       15
 8      18      8       18
 8      28      8       18
 8      28      8       18
+NULL   NULL    4       14
+NULL   NULL    5       15

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/smb_mapjoin_13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/smb_mapjoin_13.q.out 
b/ql/src/test/results/clientpositive/spark/smb_mapjoin_13.q.out
index 3bc87ee..80b32c4 100644
--- a/ql/src/test/results/clientpositive/spark/smb_mapjoin_13.q.out
+++ b/ql/src/test/results/clientpositive/spark/smb_mapjoin_13.q.out
@@ -103,7 +103,7 @@ STAGE PLANS:
                         Statistics: Num rows: 550 Data size: 5843 Basic stats: 
COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: _col0 (type: int)
-                          null sort order: a
+                          null sort order: z
                           sort order: +
                           Statistics: Num rows: 550 Data size: 5843 Basic 
stats: COMPLETE Column stats: NONE
                           tag: -1
@@ -353,7 +353,7 @@ STAGE PLANS:
                         Statistics: Num rows: 550 Data size: 5843 Basic stats: 
COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: _col0 (type: int)
-                          null sort order: a
+                          null sort order: z
                           sort order: +
                           Statistics: Num rows: 550 Data size: 5843 Basic 
stats: COMPLETE Column stats: NONE
                           tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/0427ffa5/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out 
b/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
index 0672b44..6522f9c 100644
--- a/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
+++ b/ql/src/test/results/clientpositive/spark/smb_mapjoin_15.q.out
@@ -84,7 +84,7 @@ STAGE PLANS:
                         BucketMapJoin: true
                         Reduce Output Operator
                           key expressions: _col0 (type: int)
-                          null sort order: a
+                          null sort order: z
                           sort order: +
                           Statistics: Num rows: ###Masked### Data size: 
###Masked### Basic stats: COMPLETE Column stats: NONE
                           tag: -1
@@ -313,7 +313,7 @@ STAGE PLANS:
                         BucketMapJoin: true
                         Reduce Output Operator
                           key expressions: _col0 (type: int)
-                          null sort order: a
+                          null sort order: z
                           sort order: +
                           Statistics: Num rows: ###Masked### Data size: 
###Masked### Basic stats: COMPLETE Column stats: NONE
                           tag: -1
@@ -490,7 +490,7 @@ STAGE PLANS:
                         BucketMapJoin: true
                         Reduce Output Operator
                           key expressions: _col0 (type: int)
-                          null sort order: a
+                          null sort order: z
                           sort order: +
                           Statistics: Num rows: ###Masked### Data size: 
###Masked### Basic stats: COMPLETE Column stats: NONE
                           tag: -1
@@ -817,7 +817,7 @@ STAGE PLANS:
                 Statistics: Num rows: ###Masked### Data size: ###Masked### 
Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int)
-                  null sort order: a
+                  null sort order: z
                   sort order: +
                   Statistics: Num rows: ###Masked### Data size: ###Masked### 
Basic stats: COMPLETE Column stats: NONE
                   tag: -1

Reply via email to