yashmayya commented on code in PR #15244:
URL: https://github.com/apache/pinot/pull/15244#discussion_r1991094698


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java:
##########
@@ -1596,6 +1606,32 @@ public void testNumServersQueried() throws Exception {
   }
 
   @Test
+  public void testLookupJoin() throws Exception {
+
+    Schema lookupTableSchema = createSchema(DIM_TABLE_SCHEMA_PATH);
+    addSchema(lookupTableSchema);
+    TableConfig tableConfig = createTableConfig(DIM_TABLE_TABLE_CONFIG_PATH);
+    addTableConfig(tableConfig);
+    createAndUploadSegmentFromFile(tableConfig, lookupTableSchema, 
DIM_TABLE_DATA_PATH, FileFormat.CSV,
+        DIM_NUMBER_OF_RECORDS, 60_000);
+
+    Schema primaryTableSchema = createSchema(PRIMARY_TABLE_SCHEMA_PATH);
+    addSchema(primaryTableSchema);
+    TableConfig primaryTableConfig = 
createTableConfig(PRIMARY_TABLE_TABLE_CONFIG_PATH);
+    addTableConfig(primaryTableConfig);
+    createAndUploadSegmentFromFile(primaryTableConfig, primaryTableSchema, 
PRIMARY_TABLE_DATA_PATH, FileFormat.CSV,
+        PRIMARY_NUMBER_OF_RECORDS, 60_000);
+
+    String query = "select /*+ joinOptions(join_strategy='lookup') */ yearID, 
teamName from baseballStats "
+        + "join dimBaseballTeams ON baseballStats.teamID = 
dimBaseballTeams.teamID where playerId = 'aardsda01'";
+    JsonNode jsonNode = postQuery(query);
+    long result = jsonNode.get("resultTable").get("rows").size();
+    assertEquals(result, 3);

Review Comment:
   Can we also make assertions to verify that the lookup join strategy is 
actually being used? Few ideas off the top of my head:
   
   - `EXPLAIN PLAN FOR...` output for the query should have an exchange 
attached only to the non-dimensional table side of the join and not the 
dimensional side. And I believe the distribution type should be singleton as 
opposed to a hash distribution.
   - Similarly, `EXPLAIN IMPLEMENTATION PLAN FOR...` output for the query 
should have `MAIL_SEND` / `MAIL_RECEIVE` operators only on the non dimensional 
table side of the join.
   - The actual query response should have the `LOOKUP_JOIN` operator in the 
query stats.



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