kasakrisz commented on code in PR #5627:
URL: https://github.com/apache/hive/pull/5627#discussion_r1959481775


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SortedDynPartitionOptimizer.java:
##########
@@ -635,34 +638,18 @@ public ReduceSinkOperator getReduceSinkOp(List<Integer> 
partitionPositions, List
         }
       }
 
-      // if partition and bucket columns are sorted in ascending order, by 
default
-      // nulls come first; otherwise nulls come last
-      Integer nullOrder = order == 1 ? 0 : 1;
+      char nullOrder = NullOrdering.defaultNullOrder(order, 
parseCtx.getConf()).getSign();
       if (sortNullOrder != null && !sortNullOrder.isEmpty()) {
-        if (sortNullOrder.get(0) == 0) {
-          nullOrder = 0;
-        } else {
-          nullOrder = 1;
-        }
-      }
-
-      for (Integer ignored : keyColsPosInVal) {
-        newSortNullOrder.add(nullOrder);
+        nullOrder = NullOrdering.fromCode(sortNullOrder.get(0)).getSign();

Review Comment:
   This logic was introduced by the very first implementation of 
`SortedDynPartitionOptimizer`.
   https://issues.apache.org/jira/browse/HIVE-6455
   I think the `sortOrder` is not empty only if the target table has ordering 
specified. Unfortunately the jira doesn't mention anything about such tables.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to