You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2023/05/31 06:12:03 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #10819: [Multi-stage] Support ordering null values

Jackie-Jiang commented on code in PR #10819:
URL: https://github.com/apache/pinot/pull/10819#discussion_r1211133440


##########
pinot-query-runtime/src/test/resources/queries/NullHandling.json:
##########
@@ -45,6 +45,16 @@
       {
         "description": "LEFT JOIN and GROUP BY with AGGREGATE",
         "sql": "SELECT {tbl1}.strCol2, COUNT({tbl2}.intCol1), MIN({tbl2}.intCol1), MAX({tbl2}.doubleCol1), SUM({tbl2}.doubleCol1) FROM {tbl1} LEFT OUTER JOIN {tbl2} ON {tbl1}.strCol1 = {tbl2}.strCol1 GROUP BY {tbl1}.strCol2"
+      },
+      {
+        "description": "LEFT JOIN and SORT (by default, H2 treats null as the smallest value, which is different from Postgres, thus we don't test the default ordering)",
+        "sql": "SELECT {tbl2}.doubleCol1 AS col FROM {tbl1} LEFT OUTER JOIN {tbl2} ON {tbl1}.strCol1 = {tbl2}.strCol1 ORDER BY col NULLS FIRST",
+        "keepOutputRowOrder": true
+      },
+      {
+        "description": "LEFT JOIN and GROUP BY with AGGREGATE AND SORT",
+        "sql": "SELECT {tbl1}.strCol2, COUNT({tbl2}.intCol1), MIN({tbl2}.intCol1) AS minCol, MAX({tbl2}.doubleCol1), SUM({tbl2}.doubleCol1) FROM {tbl1} LEFT OUTER JOIN {tbl2} ON {tbl1}.strCol1 = {tbl2}.strCol1 GROUP BY {tbl1}.strCol2 ORDER BY minCol DESC NULLS LAST",
+        "keepOutputRowOrder": true

Review Comment:
   One problem with LEFT JOIN is that values are either all null or all not null, so it is kind of hard to verify the behavior. Added the test into the `SortOperatorTest`



-- 
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