gortiz commented on code in PR #20092:
URL: https://github.com/apache/pinot/pull/20092#discussion_r4630272780


##########
pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/operator/LookupJoinOperatorTest.java:
##########
@@ -208,6 +212,79 @@ public void testMissingPrimaryKeyColumnsAreRejected() {
     assertTrue(exception.getMessage().contains("Failed to find primary key 
columns"), exception.getMessage());
   }
 
+  @Test
+  public void testDimensionColumnsOfTableScan() {
+    assertEquals(LookupJoinOperator.resolveDimensionColumns(tableScan(), 
TABLE_NAME),
+        new String[]{"currency", "rate", "rate_start_date"});
+  }
+
+  @Test
+  public void testDimensionColumnsFollowProjectInputRefsNotOutputNames() {
+    // SELECT currency AS rate, rate AS currency, rate_start_date, 
rate_start_date AS rate_start_date0
+    DataSchema projectSchema =
+        new DataSchema(new String[]{"rate", "currency", "rate_start_date", 
"rate_start_date0"}, new ColumnDataType[]{
+            ColumnDataType.STRING, ColumnDataType.INT, ColumnDataType.LONG, 
ColumnDataType.LONG
+        });
+    ProjectNode project = new ProjectNode(0, projectSchema, 
PlanNode.NodeHint.EMPTY, List.of(tableScan()),
+        List.of(new RexExpression.InputRef(DIM_CURRENCY), new 
RexExpression.InputRef(DIM_RATE),
+            new RexExpression.InputRef(DIM_RATE_START_DATE), new 
RexExpression.InputRef(DIM_RATE_START_DATE)));

Review Comment:
   Good idea, done in a2b1b2133c. The test now projects input refs `[2, 0, 2]` 
as `rate_start_date AS currency, currency AS rate, rate_start_date AS 
rate_start_date0`. It reorders the scan columns, prunes `rate` and repeats 
`rate_start_date`, and the output names are still other table columns.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to