You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/08/26 06:55:36 UTC

[GitHub] [calcite] cuglifangzheng opened a new pull request #2121: [CALCITE-4192]fix aggregate column origins searching by RelMdColumnOrigins

cuglifangzheng opened a new pull request #2121:
URL: https://github.com/apache/calcite/pull/2121


   fix aggregate column origins searching by RelMdColumnOrigins when relNode has optimized by AggregateProjectMergeRule.


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

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



[GitHub] [calcite] liyafan82 commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r486795640



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?




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

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



[GitHub] [calcite] cuglifangzheng commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
cuglifangzheng commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r487359768



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!




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

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



[GitHub] [calcite] danny0405 commented on a change in pull request #2121: [CALCITE-4192]Relmdcolumnorigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r478238613



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6767,24 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";
+    final RelNode rel = tester.convertSqlToRel(sql).rel;
+    final HepProgramBuilder programBuilder = HepProgram.builder();
+    programBuilder.addRuleInstance(CoreRules.AGGREGATE_PROJECT_MERGE);
+    final HepPlanner planner = new HepPlanner(programBuilder.build());
+    planner.setRoot(rel);
+    final RelNode optimizedRel = planner.findBestExp();
+
+    Set<RelColumnOrigin> origins = RelMetadataQuery.instance()
+        .getColumnOrigins(optimizedRel, 1);
+    assertEquals(1, origins.size());
+
+    RelColumnOrigin columnOrigin = origins.iterator().next();
+    assertEquals(5, columnOrigin.getOriginColumnOrdinal());
+    assertEquals("SAL", columnOrigin.getOriginTable().getRowType().getFieldNames().get(5));

Review comment:
       Calcite prefer `assertThat` than `assertEquals`.




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

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



[GitHub] [calcite] chunweilei commented on a change in pull request #2121: [CALCITE-4192]fix aggregate column origins searching by RelMdColumnOrigins

Posted by GitBox <gi...@apache.org>.
chunweilei commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r478074237



##########
File path: core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
##########
@@ -65,8 +65,8 @@ private RelMdColumnOrigins() {}
   public Set<RelColumnOrigin> getColumnOrigins(Aggregate rel,
       RelMetadataQuery mq, int iOutputColumn) {
     if (iOutputColumn < rel.getGroupCount()) {
-      // Group columns pass through directly.
-      return mq.getColumnOrigins(rel.getInput(), iOutputColumn);
+      // get actual index of Group columns.
+      return mq.getColumnOrigins(rel.getInput(), rel.getGroupSet().asList().get(iOutputColumn));

Review comment:
       The title does not describe the issue clearly. Could you improve it?




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

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



[GitHub] [calcite] cuglifangzheng commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
cuglifangzheng commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r487359768



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!




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

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



[GitHub] [calcite] cuglifangzheng commented on a change in pull request #2121: [CALCITE-4192]fix aggregate column origins searching by RelMdColumnOrigins

Posted by GitBox <gi...@apache.org>.
cuglifangzheng commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r477084585



##########
File path: core/src/test/java/org/apache/calcite/test/RelMdColumnOriginsTest.java
##########
@@ -74,4 +78,25 @@
     statement.close();
     connection.close();
   }
+

Review comment:
       ok, I will try it ,thanks! I thought i was testing RelMdColumnOrigins, so ...
   
   > Extending from `SqlToRelConverterTest` is not a good idea, why not move the test case directly into `RelOptRulesTest` ?
   
   




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

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



[GitHub] [calcite] liyafan82 commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r486795640



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?




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

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



[GitHub] [calcite] chunweilei closed pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
chunweilei closed pull request #2121:
URL: https://github.com/apache/calcite/pull/2121


   


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

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



[GitHub] [calcite] chunweilei closed pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
chunweilei closed pull request #2121:
URL: https://github.com/apache/calcite/pull/2121


   


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

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



[GitHub] [calcite] cuglifangzheng commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
cuglifangzheng commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r487359768



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!




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

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



[GitHub] [calcite] liyafan82 commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r486795640



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?

##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       The primary target of this test is related to RelMetadata, so it should be moved to RelMetadataTest?




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

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



[GitHub] [calcite] cuglifangzheng commented on a change in pull request #2121: [CALCITE-4192]fix aggregate column origins searching by RelMdColumnOrigins

Posted by GitBox <gi...@apache.org>.
cuglifangzheng commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r478162865



##########
File path: core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java
##########
@@ -65,8 +65,8 @@ private RelMdColumnOrigins() {}
   public Set<RelColumnOrigin> getColumnOrigins(Aggregate rel,
       RelMetadataQuery mq, int iOutputColumn) {
     if (iOutputColumn < rel.getGroupCount()) {
-      // Group columns pass through directly.
-      return mq.getColumnOrigins(rel.getInput(), iOutputColumn);
+      // get actual index of Group columns.
+      return mq.getColumnOrigins(rel.getInput(), rel.getGroupSet().asList().get(iOutputColumn));

Review comment:
       thank you, I will try it.




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

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



[GitHub] [calcite] danny0405 commented on a change in pull request #2121: [CALCITE-4192]fix aggregate column origins searching by RelMdColumnOrigins

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r477082082



##########
File path: core/src/test/java/org/apache/calcite/test/RelMdColumnOriginsTest.java
##########
@@ -74,4 +78,25 @@
     statement.close();
     connection.close();
   }
+

Review comment:
       Extending from `SqlToRelConverterTest` is not a good idea, why not move the test case directly into `RelOptRulesTest` ?




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

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



[GitHub] [calcite] cuglifangzheng commented on a change in pull request #2121: [CALCITE-4192] RelMdColumnOrigins should obtain the true column index of the group by column of the aggregation operator instead of passing through directly

Posted by GitBox <gi...@apache.org>.
cuglifangzheng commented on a change in pull request #2121:
URL: https://github.com/apache/calcite/pull/2121#discussion_r487359768



##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6764,4 +6769,25 @@ protected MyProjectRule(Config config) {
         .checkUnchanged();
   }
 
+  /** Test case for
+   * <a href="https://issues.apache.org/jira/browse/CALCITE-4192">[CALCITE-4192]
+   * fix aggregate column origins searching by RelMdColumnOrigins</a>. */
+  @Test void testColumnOriginAfterAggProjectMergeRule() {
+    final String sql = "select count(ename), SAL from emp group by SAL";

Review comment:
       thanks, good idea!




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

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