julianhyde commented on code in PR #4328:
URL: https://github.com/apache/calcite/pull/4328#discussion_r2058740021


##########
core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java:
##########
@@ -473,6 +478,117 @@ public TrimResult trimFields(
     return result(newCalc, mapping, calc);
   }
 
+  /**
+   * Shuttle that finds all references to a {@link TableScan} within a tree
+   * of {@link RelNode}s.
+   */
+  private static class InputTables extends RelHomogeneousShuttle {

Review Comment:
   a plural word is not a good name for a class



##########
core/src/main/java/org/apache/calcite/plan/RelOptUtil.java:
##########
@@ -991,7 +991,7 @@ public static RelNode createSingleValueAggRel(
       RelOptCluster cluster,
       RelNode rel) {
     final int aggCallCnt = rel.getRowType().getFieldCount();
-    final List<AggregateCall> aggCalls = new ArrayList<>();
+    final List<AggregateCall> aggCalls = new ArrayList<>(aggCallCnt);

Review Comment:
   I don't think this "optimization" is worthwhile. If you're really concerned 
about memory allocation, use `ImmutableList.builder()`.



##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -910,6 +911,13 @@ private static void matchJoin(SubQueryRemoveRule rule, 
RelOptRuleCall call) {
     int nFieldsLeft = join.getLeft().getRowType().getFieldCount();
     int nFieldsRight = join.getRight().getRowType().getFieldCount();
 
+    // Correlation columns are also should be considered.

Review Comment:
   This comment would benefit from an example.



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

Reply via email to