siddharthteotia commented on code in PR #8993:
URL: https://github.com/apache/pinot/pull/8993#discussion_r910677514


##########
pinot-core/src/test/java/org/apache/pinot/queries/MultiValueRawQueriesTest.java:
##########
@@ -338,6 +338,445 @@ public void testSelectQueries() {
     }
   }
 
+  @Test
+  public void testNonAggregateMVGroupBY() {
+    {
+      // TODO: Today ORDER BY on MV columns (irrespective of whether it's 
dictionary based or raw) doesn't work
+      //       Fix ORDER BY only for MV columns
+      String query = "SELECT mvFloatCol from testTable WHERE mvFloatCol < 5 
ORDER BY mvFloatCol LIMIT 10";
+      BrokerResponseNative brokerResponseNative = getBrokerResponse(query);
+      assertEquals(brokerResponseNative.getProcessingExceptions().size(), 2);
+    }
+    {
+      // Test a group by query on some raw MV rows. Order by on SV column 
added for determinism
+      String query = "SELECT svIntCol, mvRawFloatCol, mvRawDoubleCol, 
mvRawStringCol from testTable GROUP BY "
+          + "svIntCol, mvRawFloatCol, mvRawDoubleCol, mvRawStringCol ORDER BY 
svIntCol LIMIT 10";
+      ResultTable resultTable = getBrokerResponse(query).getResultTable();
+      assertNotNull(resultTable);
+      DataSchema dataSchema = new DataSchema(new String[]{
+          "svIntCol", "mvRawFloatCol", "mvRawDoubleCol", "mvRawStringCol"
+      }, new DataSchema.ColumnDataType[]{
+          DataSchema.ColumnDataType.INT, DataSchema.ColumnDataType.FLOAT, 
DataSchema.ColumnDataType.DOUBLE,
+          DataSchema.ColumnDataType.STRING
+      });
+      assertEquals(resultTable.getDataSchema(), dataSchema);
+      List<Object[]> recordRows = resultTable.getRows();
+      assertEquals(recordRows.size(), 10);
+
+      int[] expectedSVInts = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+
+      for (int i = 0; i < 10; i++) {
+        Object[] values = recordRows.get(i);
+        assertEquals(values.length, 4);
+        assertEquals((int) values[0], expectedSVInts[i]);
+      }
+    }
+    {
+      // Test a group by order by query on some raw MV rows (order by on int 
and double)
+      String query = "SELECT mvRawIntCol, mvRawDoubleCol, mvRawStringCol from 
testTable GROUP BY mvRawIntCol, "
+          + "mvRawDoubleCol, mvRawStringCol ORDER BY mvRawIntCol, 
mvRawDoubleCol LIMIT 20";

Review Comment:
   This seems to contradict the TODO mentioned at line 344 regarding ORDER BY 
support for MV ?



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to