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 2019/12/30 19:42:37 UTC

[GitHub] [calcite] amaliujia commented on a change in pull request #1707: [CALCITE-3649] Hints should be propagated correctly in planner rules …

amaliujia commented on a change in pull request #1707: [CALCITE-3649] Hints should be propagated correctly in planner rules …
URL: https://github.com/apache/calcite/pull/1707#discussion_r362078231
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java
 ##########
 @@ -387,6 +389,25 @@ protected DiffRepository getDiffRepos() {
         Collections.emptyList(), Collections.emptyList());
   }
 
+  @Test public void testHintsPropagateWithDifferentKindOfRels() {
+    final String sql = "select /*+ AGG_STRATEGY(TWO_PHASE) */\n"
+        + "ename, avg(sal)\n"
+        + "from emp group by ename";
+    final RelNode rel = tester.convertSqlToRel(sql).rel;
+    final RelHint hint = RelHint.of(
+        Collections.emptyList(),
+        "AGG_STRATEGY",
+        Collections.singletonList("TWO_PHASE"));
+    // Validate Hep planner.
+    HepProgram program = new HepProgramBuilder()
+        .addRuleInstance(AggregateReduceFunctionsRule.INSTANCE)
 
 Review comment:
   Maybe write a mock rule (similar to `MockJoin`) to simulate the `Project + Aggregate` split that you want to test?
   
   
   I had a hard time to understand why `AggregateReduceFunctionsRule` will trigger what expects be tested?

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


With regards,
Apache Git Services