http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/partition_coltype_literals.q.out
----------------------------------------------------------------------
diff --git 
a/ql/src/test/results/clientpositive/partition_coltype_literals.q.out 
b/ql/src/test/results/clientpositive/partition_coltype_literals.q.out
index bc159eb..1a93b7a 100644
--- a/ql/src/test/results/clientpositive/partition_coltype_literals.q.out
+++ b/ql/src/test/results/clientpositive/partition_coltype_literals.q.out
@@ -154,7 +154,7 @@ OutputFormat:               
org.apache.hadoop.hive.ql.io.RCFileOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [key]                    
-Sort Columns:          [Order(col:key, order:0)]        
+Sort Columns:          [Order(col:key, order:0, nullOrder:1)]   
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: -- rename partition
@@ -205,7 +205,7 @@ OutputFormat:               
org.apache.hadoop.hive.ql.io.RCFileOutputFormat
 Compressed:            No                       
 Num Buckets:           4                        
 Bucket Columns:        [key]                    
-Sort Columns:          [Order(col:key, order:0)]        
+Sort Columns:          [Order(col:key, order:0, nullOrder:1)]   
 Storage Desc Params:            
        serialization.format    1                   
 PREHOOK: query: -- insert partition

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/pcr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pcr.q.out 
b/ql/src/test/results/clientpositive/pcr.q.out
index 89c5c22..056b092 100644
--- a/ql/src/test/results/clientpositive/pcr.q.out
+++ b/ql/src/test/results/clientpositive/pcr.q.out
@@ -85,11 +85,13 @@ TOK_QUERY
                5
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -114,6 +116,7 @@ STAGE PLANS:
                 Statistics: Num rows: 13 Data size: 104 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Statistics: Num rows: 13 Data size: 104 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -306,8 +309,9 @@ TOK_QUERY
                5
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -332,6 +336,7 @@ STAGE PLANS:
                 Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int)
+                  null sort order: a
                   sort order: +
                   Statistics: Num rows: 40 Data size: 320 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -615,11 +620,13 @@ TOK_QUERY
                'val_2'
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -644,6 +651,7 @@ STAGE PLANS:
                 Statistics: Num rows: 13 Data size: 104 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Statistics: Num rows: 13 Data size: 104 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -851,11 +859,13 @@ TOK_QUERY
                   'val_5'
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -880,6 +890,7 @@ STAGE PLANS:
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE 
Column stats: NONE
                   tag: -1
@@ -1089,11 +1100,13 @@ TOK_QUERY
                   'val_5'
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -1118,6 +1131,7 @@ STAGE PLANS:
                 Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Statistics: Num rows: 16 Data size: 128 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -1383,11 +1397,13 @@ TOK_QUERY
                   'val_5'
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -1412,6 +1428,7 @@ STAGE PLANS:
                 Statistics: Num rows: 33 Data size: 264 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Statistics: Num rows: 33 Data size: 264 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -1677,11 +1694,13 @@ TOK_QUERY
                14
       TOK_ORDERBY
          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
 
 
 STAGE DEPENDENCIES:
@@ -1706,6 +1725,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: 14 (type: int), _col1 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -1887,11 +1907,13 @@ TOK_QUERY
                '2000-04-09'
       TOK_ORDERBY
          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
 
 
 STAGE DEPENDENCIES:
@@ -1912,6 +1934,7 @@ STAGE PLANS:
               Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int), _col1 (type: string)
+                null sort order: aa
                 sort order: ++
                 Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
                 tag: -1
@@ -2133,11 +2156,13 @@ TOK_QUERY
                '2000-04-10'
       TOK_ORDERBY
          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
 
 
 STAGE DEPENDENCIES:
@@ -2158,6 +2183,7 @@ STAGE PLANS:
               Statistics: Num rows: 60 Data size: 480 Basic stats: COMPLETE 
Column stats: NONE
               Reduce Output Operator
                 key expressions: _col0 (type: int), _col1 (type: string)
+                null sort order: aa
                 sort order: ++
                 Statistics: Num rows: 60 Data size: 480 Basic stats: COMPLETE 
Column stats: NONE
                 tag: -1
@@ -2460,14 +2486,17 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -2492,6 +2521,7 @@ STAGE PLANS:
                 Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 40 Data size: 320 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -2689,10 +2719,11 @@ TOK_QUERY
             TOK_ALLCOLREF
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -2718,6 +2749,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -2738,6 +2770,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -2829,6 +2862,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int)
+              null sort order: a
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -2991,10 +3025,11 @@ TOK_QUERY
             TOK_ALLCOLREF
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -3020,6 +3055,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -3040,6 +3076,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -3177,6 +3214,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int)
+              null sort order: a
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -3354,14 +3392,17 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -3386,6 +3427,7 @@ STAGE PLANS:
                 Statistics: Num rows: 48 Data size: 384 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 48 Data size: 384 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -3718,14 +3760,17 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -3750,6 +3795,7 @@ STAGE PLANS:
                 Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 30 Data size: 240 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -5268,8 +5314,9 @@ TOK_QUERY
                11
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
       TOK_LIMIT
          10
 
@@ -5292,6 +5339,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: +
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
                 tag: -1
@@ -5446,14 +5494,17 @@ TOK_QUERY
                11
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               hr
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  hr
 
 
 STAGE DEPENDENCIES:
@@ -5478,6 +5529,7 @@ STAGE PLANS:
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: '11' (type: string), '2008-04-08' (type: 
string), _col3 (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -5670,14 +5722,17 @@ TOK_QUERY
                11
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               key
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  key
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               hr
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  hr
 
 
 STAGE DEPENDENCIES:
@@ -5702,6 +5757,7 @@ STAGE PLANS:
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: '11' (type: string), _col2 (type: string), 
'11' (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/pcs.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pcs.q.out 
b/ql/src/test/results/clientpositive/pcs.q.out
index 51a21dd..a1382f1 100644
--- a/ql/src/test/results/clientpositive/pcs.q.out
+++ b/ql/src/test/results/clientpositive/pcs.q.out
@@ -125,14 +125,17 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -157,6 +160,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -788,6 +792,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: ds (type: string)
+              null sort order: a
               sort order: +
               Map-reduce partition columns: ds (type: string)
               Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
@@ -800,6 +805,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: ds (type: string)
+              null sort order: a
               sort order: +
               Map-reduce partition columns: ds (type: string)
               Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
@@ -1198,7 +1204,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:
@@ -1356,20 +1362,23 @@ TOK_QUERY
             '2008-04-08'
       TOK_SORTBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  A
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     A
+                  key
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  A
-               value
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     A
+                  value
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  A
-               ds
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     A
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -1400,6 +1409,7 @@ STAGE PLANS:
                     Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col0 (type: int), _col1 (type: 
string), '2008-04-08' (type: string)
+                      null sort order: aaa
                       sort order: +++
                       Statistics: Num rows: 2 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       tag: -1
@@ -1424,6 +1434,7 @@ STAGE PLANS:
                     Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                     Reduce Output Operator
                       key expressions: _col0 (type: int), _col1 (type: 
string), '2008-04-08' (type: string)
+                      null sort order: aaa
                       sort order: +++
                       Statistics: Num rows: 2 Data size: 0 Basic stats: 
PARTIAL Column stats: NONE
                       tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query12.q.out 
b/ql/src/test/results/clientpositive/perf/query12.q.out
index f326a92..986a307 100644
--- a/ql/src/test/results/clientpositive/perf/query12.q.out
+++ b/ql/src/test/results/clientpositive/perf/query12.q.out
@@ -24,7 +24,7 @@ Stage-0
               Select Operator [SEL_21] (rows=34938 width=1436)
                 
Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                 PTF Operator [PTF_20] (rows=34938 width=1436)
-                  Function 
definitions:[{},{"name:":"windowingtablefunction","order 
by:":"_col3","partition by:":"_col3"}]
+                  Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS 
FIRST","partition by:":"_col3"}]
                   Select Operator [SEL_19] (rows=34938 width=1436)
                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                   <-Reducer 4 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query20.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query20.q.out 
b/ql/src/test/results/clientpositive/perf/query20.q.out
index 74d286a..9af7729 100644
--- a/ql/src/test/results/clientpositive/perf/query20.q.out
+++ b/ql/src/test/results/clientpositive/perf/query20.q.out
@@ -26,7 +26,7 @@ Stage-0
               Select Operator [SEL_23] (rows=139755 width=1436)
                 
Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                 PTF Operator [PTF_22] (rows=139755 width=1436)
-                  Function 
definitions:[{},{"name:":"windowingtablefunction","order 
by:":"_col3","partition by:":"_col3"}]
+                  Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS 
FIRST","partition by:":"_col3"}]
                   Select Operator [SEL_21] (rows=139755 width=1436)
                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                   <-Reducer 4 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query51.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query51.q.out 
b/ql/src/test/results/clientpositive/perf/query51.q.out
index f568ead..08546c5 100644
--- a/ql/src/test/results/clientpositive/perf/query51.q.out
+++ b/ql/src/test/results/clientpositive/perf/query51.q.out
@@ -112,7 +112,7 @@ Stage-0
                 Filter Operator [FIL_58] (rows=7365 width=1119)
                   predicate:(max_window_0 > max_window_1)
                   PTF Operator [PTF_45] (rows=22096 width=1119)
-                    Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"CASE WHEN (_col1 
is not null) THEN (_col1) ELSE (_col4) END","partition by:":"CASE WHEN (_col0 
is not null) THEN (_col0) ELSE (_col3) END"}]
+                    Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"CASE WHEN (_col1 
is not null) THEN (_col1) ELSE (_col4) END ASC NULLS FIRST","partition 
by:":"CASE WHEN (_col0 is not null) THEN (_col0) ELSE (_col3) END"}]
                     Select Operator [SEL_44] (rows=22096 width=1119)
                       Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                     <-Reducer 4 [SIMPLE_EDGE]
@@ -126,7 +126,7 @@ Stage-0
                             Select Operator [SEL_37] (rows=20088 width=1119)
                               Output:["_col0","_col1","_col2"]
                               PTF Operator [PTF_36] (rows=20088 width=1119)
-                                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_32] (rows=20088 
width=1119)
                                   
Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0,
 KEY._col1
                                 <-Reducer 9 [SIMPLE_EDGE]
@@ -162,7 +162,7 @@ Stage-0
                             Select Operator [SEL_17] (rows=20088 width=1119)
                               Output:["_col0","_col1","_col2"]
                               PTF Operator [PTF_16] (rows=20088 width=1119)
-                                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_12] (rows=20088 
width=1119)
                                   
Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0,
 KEY._col1
                                 <-Reducer 2 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query67.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query67.q.out 
b/ql/src/test/results/clientpositive/perf/query67.q.out
index f158829..83dab38 100644
--- a/ql/src/test/results/clientpositive/perf/query67.q.out
+++ b/ql/src/test/results/clientpositive/perf/query67.q.out
@@ -111,7 +111,7 @@ Stage-0
                 Filter Operator [FIL_47] (rows=762300 width=1436)
                   predicate:(rank_window_0 <= 100)
                   PTF Operator [PTF_29] (rows=2286900 width=1436)
-                    Function 
definitions:[{},{"name:":"windowingtablefunction","order 
by:":"_col16(DESC)","partition by:":"_col0"}]
+                    Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col16 DESC 
NULLS LAST","partition by:":"_col0"}]
                     Select Operator [SEL_28] (rows=2286900 width=1436)
                       
Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col16"]
                     <-Reducer 5 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query70.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query70.q.out 
b/ql/src/test/results/clientpositive/perf/query70.q.out
index b921346..37cebc8 100644
--- a/ql/src/test/results/clientpositive/perf/query70.q.out
+++ b/ql/src/test/results/clientpositive/perf/query70.q.out
@@ -31,7 +31,7 @@ Stage-0
               Select Operator [SEL_57] (rows=66289 width=1119)
                 Output:["_col0","_col1","_col2","_col3","_col4"]
                 PTF Operator [PTF_56] (rows=66289 width=1119)
-                  Function 
definitions:[{},{"name:":"windowingtablefunction","order 
by:":"_col4","partition by:":"_col5, CASE WHEN ((_col5 = 2)) THEN (_col0) ELSE 
(null) END"}]
+                  Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col4 ASC NULLS 
FIRST","partition by:":"_col5, CASE WHEN ((_col5 = 2)) THEN (_col0) ELSE (null) 
END"}]
                   Select Operator [SEL_55] (rows=66289 width=1119)
                     Output:["_col0","_col1","_col4","_col5"]
                   <-Reducer 4 [SIMPLE_EDGE]
@@ -97,7 +97,7 @@ Stage-0
                                             Filter Operator [FIL_83] 
(rows=6696 width=1119)
                                               predicate:(rank_window_0 <= 5)
                                               PTF Operator [PTF_31] 
(rows=20088 width=1119)
-                                                Function 
definitions:[{},{"name:":"windowingtablefunction","order 
by:":"_col1(DESC)","partition by:":"_col0"}]
+                                                Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 DESC NULLS 
LAST","partition by:":"_col0"}]
                                                 Select Operator [SEL_30] 
(rows=20088 width=1119)
                                                   Output:["_col0","_col1"]
                                                 <-Reducer 13 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query89.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query89.q.out 
b/ql/src/test/results/clientpositive/perf/query89.q.out
index 71db5d4..0cda449 100644
--- a/ql/src/test/results/clientpositive/perf/query89.q.out
+++ b/ql/src/test/results/clientpositive/perf/query89.q.out
@@ -81,7 +81,7 @@ Stage-0
                   Select Operator [SEL_29] (rows=153730 width=1436)
                     
Output:["avg_window_0","_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                     PTF Operator [PTF_28] (rows=153730 width=1436)
-                      Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0, _col2, 
_col3, _col4","partition by:":"_col0, _col2, _col3, _col4"}]
+                      Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS 
FIRST, _col2 ASC NULLS FIRST, _col3 ASC NULLS FIRST, _col4 ASC NULLS 
FIRST","partition by:":"_col0, _col2, _col3, _col4"}]
                       Select Operator [SEL_27] (rows=153730 width=1436)
                         
Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                       <-Reducer 5 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/perf/query98.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query98.q.out 
b/ql/src/test/results/clientpositive/perf/query98.q.out
index f51744d..fc4b7a3 100644
--- a/ql/src/test/results/clientpositive/perf/query98.q.out
+++ b/ql/src/test/results/clientpositive/perf/query98.q.out
@@ -24,7 +24,7 @@ Stage-0
             Select Operator [SEL_23] (rows=139755 width=1436)
               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
               PTF Operator [PTF_22] (rows=139755 width=1436)
-                Function 
definitions:[{},{"name:":"windowingtablefunction","order 
by:":"_col3","partition by:":"_col3"}]
+                Function 
definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS 
FIRST","partition by:":"_col3"}]
                 Select Operator [SEL_21] (rows=139755 width=1436)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                 <-Reducer 4 [SIMPLE_EDGE]

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/pointlookup2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup2.q.out 
b/ql/src/test/results/clientpositive/pointlookup2.q.out
index 5192e1a..fb17e72 100644
--- a/ql/src/test/results/clientpositive/pointlookup2.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup2.q.out
@@ -141,14 +141,17 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -173,6 +176,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string)
+                  null sort order: aaa
                   sort order: +++
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -365,10 +369,11 @@ TOK_QUERY
             TOK_ALLCOLREF
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -394,6 +399,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -414,6 +420,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -505,6 +512,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int)
+              null sort order: a
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -627,10 +635,11 @@ TOK_QUERY
             TOK_ALLCOLREF
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -656,6 +665,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -676,6 +686,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -813,6 +824,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int)
+              null sort order: a
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -941,20 +953,23 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t2
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t2
+                  key
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t2
-               value
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t2
+                  value
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               ds
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -979,6 +994,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: 0
@@ -997,6 +1013,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                   tag: 1
@@ -1182,6 +1199,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col4 (type: int), _col5 (type: string), _col2 
(type: string)
+              null sort order: aaa
               sort order: +++
               Statistics: Num rows: 11 Data size: 88 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -1310,20 +1328,23 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               value
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  value
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t2
-               ds
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t2
+                  ds
 
 
 STAGE DEPENDENCIES:
@@ -1348,6 +1369,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   Statistics: Num rows: 30 Data size: 240 Basic stats: 
COMPLETE Column stats: NONE
                   tag: 0
@@ -1366,6 +1388,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE 
Column stats: NONE
                   tag: 1
@@ -1597,6 +1620,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int), _col1 (type: string), _col3 
(type: string)
+              null sort order: aaa
               sort order: +++
               Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/pointlookup3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup3.q.out 
b/ql/src/test/results/clientpositive/pointlookup3.q.out
index 791be61..d5c4157 100644
--- a/ql/src/test/results/clientpositive/pointlookup3.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup3.q.out
@@ -98,17 +98,21 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds1
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds1
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds2
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds2
 
 
 STAGE DEPENDENCIES:
@@ -133,6 +137,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string)
+                  null sort order: aaaa
                   sort order: ++++
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -338,17 +343,21 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds1
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds1
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds2
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds2
 
 
 STAGE DEPENDENCIES:
@@ -373,6 +382,7 @@ STAGE PLANS:
                 Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: 1 (type: int), _col1 (type: string), _col2 
(type: string), '2001-04-08' (type: string)
+                  null sort order: aaaa
                   sort order: ++++
                   Statistics: Num rows: 10 Data size: 80 Basic stats: COMPLETE 
Column stats: NONE
                   tag: -1
@@ -520,10 +530,11 @@ TOK_QUERY
             TOK_ALLCOLREF
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -549,6 +560,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -569,6 +581,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -661,6 +674,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int)
+              null sort order: a
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -783,10 +797,11 @@ TOK_QUERY
             TOK_ALLCOLREF
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  key
 
 
 STAGE DEPENDENCIES:
@@ -812,6 +827,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -832,6 +848,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 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: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
@@ -971,6 +988,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: int)
+              null sort order: a
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1
@@ -1099,20 +1117,23 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t2
-               key
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t2
+                  key
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t2
-               value
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t2
+                  value
          TOK_TABSORTCOLNAMEASC
-            .
-               TOK_TABLE_OR_COL
-                  t1
-               ds1
+            TOK_NULLS_FIRST
+               .
+                  TOK_TABLE_OR_COL
+                     t1
+                  ds1
 
 
 STAGE DEPENDENCIES:
@@ -1137,6 +1158,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2, _col3
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: 0
@@ -1155,6 +1177,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2, _col3
                 Statistics: Num rows: 30 Data size: 240 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
+                  null sort order: 
                   sort order: 
                   Statistics: Num rows: 30 Data size: 240 Basic stats: 
COMPLETE Column stats: NONE
                   tag: 1
@@ -1344,6 +1367,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col4 (type: int), _col5 (type: string), _col2 
(type: string)
+              null sort order: aaa
               sort order: +++
               Statistics: Num rows: 16 Data size: 128 Basic stats: COMPLETE 
Column stats: NONE
               tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/pointlookup4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup4.q.out 
b/ql/src/test/results/clientpositive/pointlookup4.q.out
index 948ea7a..0a9bd3e 100644
--- a/ql/src/test/results/clientpositive/pointlookup4.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup4.q.out
@@ -108,17 +108,21 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds1
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds1
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds2
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds2
 
 
 STAGE DEPENDENCIES:
@@ -143,6 +147,7 @@ STAGE PLANS:
                 Statistics: Num rows: 40 Data size: 320 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string)
+                  null sort order: aaaa
                   sort order: ++++
                   Statistics: Num rows: 40 Data size: 320 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1
@@ -348,17 +353,21 @@ TOK_QUERY
                   2
       TOK_ORDERBY
          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_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds1
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds1
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds2
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds2
 
 
 STAGE DEPENDENCIES:
@@ -383,6 +392,7 @@ STAGE PLANS:
                 Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int), _col1 (type: string), 
_col2 (type: string), _col3 (type: string)
+                  null sort order: aaaa
                   sort order: ++++
                   Statistics: Num rows: 20 Data size: 160 Basic stats: 
COMPLETE Column stats: NONE
                   tag: -1

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/ppd_join_filter.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join_filter.q.out 
b/ql/src/test/results/clientpositive/ppd_join_filter.q.out
index 8b640e1..74d2de1 100644
--- a/ql/src/test/results/clientpositive/ppd_join_filter.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join_filter.q.out
@@ -144,6 +144,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
@@ -250,6 +251,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
@@ -259,6 +261,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: string)
+              null sort order: a
               sort order: +
               Map-reduce partition columns: _col0 (type: string)
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE 
Column stats: NONE
@@ -558,6 +561,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
@@ -664,6 +668,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
@@ -673,6 +678,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: string)
+              null sort order: a
               sort order: +
               Map-reduce partition columns: _col0 (type: string)
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE 
Column stats: NONE
@@ -972,6 +978,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
@@ -1078,6 +1085,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
@@ -1087,6 +1095,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: string)
+              null sort order: a
               sort order: +
               Map-reduce partition columns: _col0 (type: string)
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE 
Column stats: NONE
@@ -1386,6 +1395,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
@@ -1492,6 +1502,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
@@ -1501,6 +1512,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col0 (type: string)
+              null sort order: a
               sort order: +
               Map-reduce partition columns: _col0 (type: string)
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE 
Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/ppd_union_view.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_union_view.q.out 
b/ql/src/test/results/clientpositive/ppd_union_view.q.out
index 210cece..36bb214 100644
--- a/ql/src/test/results/clientpositive/ppd_union_view.q.out
+++ b/ql/src/test/results/clientpositive/ppd_union_view.q.out
@@ -182,6 +182,7 @@ STAGE PLANS:
                 Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Map-reduce partition columns: _col0 (type: string), _col2 
(type: string)
                   Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE 
Column stats: NONE
@@ -202,6 +203,7 @@ STAGE PLANS:
                 Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col1 (type: string), _col2 (type: string)
+                  null sort order: aa
                   sort order: ++
                   Map-reduce partition columns: _col1 (type: string), _col2 
(type: string)
                   Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE 
Column stats: NONE
@@ -529,6 +531,7 @@ STAGE PLANS:
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: string), '2011-10-15' (type: 
string)
+                  null sort order: aa
                   sort order: ++
                   Map-reduce partition columns: _col0 (type: string), 
'2011-10-15' (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
@@ -549,6 +552,7 @@ STAGE PLANS:
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col1 (type: string), '2011-10-15' (type: 
string)
+                  null sort order: aa
                   sort order: ++
                   Map-reduce partition columns: _col1 (type: string), 
'2011-10-15' (type: string)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL 
Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/9350b693/ql/src/test/results/clientpositive/ppd_vc.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_vc.q.out 
b/ql/src/test/results/clientpositive/ppd_vc.q.out
index 69a9bc6..4575172 100644
--- a/ql/src/test/results/clientpositive/ppd_vc.q.out
+++ b/ql/src/test/results/clientpositive/ppd_vc.q.out
@@ -390,14 +390,17 @@ TOK_QUERY
                   b
       TOK_ORDERBY
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               ds
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  ds
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               hr
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  hr
          TOK_TABSORTCOLNAMEASC
-            TOK_TABLE_OR_COL
-               BLOCK__OFFSET__INSIDE__FILE
+            TOK_NULLS_FIRST
+               TOK_TABLE_OR_COL
+                  BLOCK__OFFSET__INSIDE__FILE
 
 
 STAGE DEPENDENCIES:
@@ -423,6 +426,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
@@ -442,6 +446,7 @@ STAGE PLANS:
                 Statistics: Num rows: 222 Data size: 2358 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: 222 Data size: 2358 Basic stats: 
COMPLETE Column stats: NONE
@@ -724,6 +729,7 @@ STAGE PLANS:
             GatherStats: false
             Reduce Output Operator
               key expressions: _col2 (type: string), _col3 (type: string), 
_col4 (type: bigint)
+              null sort order: aaa
               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/9350b693/ql/src/test/results/clientpositive/ppd_windowing1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_windowing1.q.out 
b/ql/src/test/results/clientpositive/ppd_windowing1.q.out
index 071b730..5f73138 100644
--- a/ql/src/test/results/clientpositive/ppd_windowing1.q.out
+++ b/ql/src/test/results/clientpositive/ppd_windowing1.q.out
@@ -37,7 +37,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:
@@ -103,7 +103,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:
@@ -169,7 +169,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:
@@ -235,7 +235,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:
@@ -301,7 +301,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:
@@ -369,7 +369,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -435,7 +435,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -501,7 +501,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -567,7 +567,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -633,7 +633,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -702,7 +702,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -748,7 +748,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -815,7 +815,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -861,7 +861,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -928,7 +928,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -974,7 +974,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -1041,7 +1041,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1087,7 +1087,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -1156,7 +1156,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1202,7 +1202,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -1269,7 +1269,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1315,7 +1315,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -1382,7 +1382,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1428,7 +1428,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -1495,7 +1495,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1541,7 +1541,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col1
+                  order by: _col1 ASC NULLS FIRST
                   partition by: _col1
                   raw input shape:
                   window functions:
@@ -1607,7 +1607,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1653,7 +1653,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col2
+                  order by: _col2 ASC NULLS FIRST
                   partition by: _col2
                   raw input shape:
                   window functions:
@@ -1722,7 +1722,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: (UDFToDouble(_col0) + UDFToDouble(2))
+                  order by: (UDFToDouble(_col0) + UDFToDouble(2)) ASC NULLS 
FIRST
                   partition by: (UDFToDouble(_col0) + UDFToDouble(2))
                   raw input shape:
                   window functions:
@@ -1789,7 +1789,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: (UDFToDouble(_col0) + UDFToDouble(_col1))
+                  order by: (UDFToDouble(_col0) + UDFToDouble(_col1)) ASC 
NULLS FIRST
                   partition by: (UDFToDouble(_col0) + UDFToDouble(_col1))
                   raw input shape:
                   window functions:
@@ -1857,7 +1857,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0, _col1
+                  order by: _col0 ASC NULLS FIRST, _col1 ASC NULLS FIRST
                   partition by: _col0, _col1
                   raw input shape:
                   window functions:
@@ -1924,7 +1924,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: (UDFToDouble(_col0) + UDFToDouble(_col1))
+                  order by: (UDFToDouble(_col0) + UDFToDouble(_col1)) ASC 
NULLS FIRST
                   partition by: (UDFToDouble(_col0) + UDFToDouble(_col1))
                   raw input shape:
                   window functions:
@@ -1991,7 +1991,7 @@ STAGE PLANS:
                 Windowing table definition
                   input alias: ptf_1
                   name: windowingtablefunction
-                  order by: _col0
+                  order by: _col0 ASC NULLS FIRST
                   partition by: _col0
                   raw input shape:
                   window functions:

Reply via email to