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


##########
pinot-core/src/test/java/org/apache/pinot/queries/ForwardIndexDisabledSingleValueQueriesTest.java:
##########
@@ -700,6 +711,142 @@ public void testSelectQueries() {
     }
   }
 
+  @Test
+  public void testSelectQueriesWithReload()
+      throws Exception {
+    // Selection query with '<' filter on a forwardIndexDisabled column with 
range index available
+    // This is just a sanity check to ensure the query works when forward 
index is enabled
+    String query = "SELECT column1, column5, column9, column11 FROM testTable 
WHERE column6 < 2147458029 AND "
+        + "column6 > 1699000 ORDER BY column1";
+    BrokerResponseNative brokerResponseNative = getBrokerResponse(query);
+    assertTrue(brokerResponseNative.getProcessingExceptions() == null
+        || brokerResponseNative.getProcessingExceptions().size() == 0);
+    ResultTable resultTable = brokerResponseNative.getResultTable();
+    assertEquals(brokerResponseNative.getNumRowsResultSet(), 10);
+    assertEquals(brokerResponseNative.getTotalDocs(), 120_000L);
+    assertEquals(brokerResponseNative.getNumDocsScanned(), 119_980L);
+    assertEquals(brokerResponseNative.getNumSegmentsProcessed(), 4L);
+    assertEquals(brokerResponseNative.getNumSegmentsMatched(), 4L);
+    assertEquals(brokerResponseNative.getNumEntriesScannedPostFilter(), 
120_100L);
+    assertEquals(brokerResponseNative.getNumEntriesScannedInFilter(), 0L);
+    assertNotNull(brokerResponseNative.getProcessingExceptions());
+    assertEquals(brokerResponseNative.getProcessingExceptions().size(), 0);
+    DataSchema dataSchema = new DataSchema(new String[]{"column1", "column5", 
"column9", "column11"},
+        new DataSchema.ColumnDataType[]{DataSchema.ColumnDataType.INT, 
DataSchema.ColumnDataType.STRING,
+            DataSchema.ColumnDataType.INT, DataSchema.ColumnDataType.STRING});
+    assertEquals(resultTable.getDataSchema(), dataSchema);
+    List<Object[]> resultRows = resultTable.getRows();
+    int previousColumn1 = Integer.MIN_VALUE;
+    for (Object[] resultRow : resultRows) {
+      assertEquals(resultRow.length, 4);
+      assertEquals((String) resultRow[1], "gFuH");
+      assertTrue((Integer) resultRow[0] >= previousColumn1);
+      previousColumn1 = (Integer) resultRow[0];
+    }
+    Object[] firstRow = resultRows.get(0);
+    // Column 11
+    assertEquals((String) firstRow[3], "o");
+
+    // Disable forward index for some columns

Review Comment:
   (nit) suggest adding the column names to the comment as well



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