You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/07/08 03:48:25 UTC

[GitHub] [pinot] nizarhejazi commented on a diff in pull request #8927: Proper null handling in SELECT, ORDER BY, DISTINCT, and GROUP BY

nizarhejazi commented on code in PR #8927:
URL: https://github.com/apache/pinot/pull/8927#discussion_r916439619


##########
pinot-core/src/main/java/org/apache/pinot/core/data/table/TableResizer.java:
##########
@@ -84,9 +84,23 @@ public TableResizer(DataSchema dataSchema, QueryContext queryContext) {
       _orderByValueExtractors[i] = getOrderByValueExtractor(orderByExpression.getExpression());
       comparators[i] = orderByExpression.isAsc() ? Comparator.naturalOrder() : Comparator.reverseOrder();
     }
+    boolean isNullHandlingEnabled = queryContext.isNullHandlingEnabled();
     _intermediateRecordComparator = (o1, o2) -> {
       for (int i = 0; i < _numOrderByExpressions; i++) {
-        int result = comparators[i].compare(o1._values[i], o2._values[i]);
+        Object v1 = o1._values[i];
+        Object v2 = o2._values[i];
+        if (isNullHandlingEnabled) {

Review Comment:
   I did not do that at first because of the duplicate code .. makes sense for perf reasons.



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org