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 2022/02/09 08:15:54 UTC

[GitHub] [calcite] wojustme opened a new pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

wojustme opened a new pull request #2714:
URL: https://github.com/apache/calcite/pull/2714


   Link to [CALCITE-5000](https://issues.apache.org/jira/browse/CALCITE-5000)
   
   The arg of max/min exists in the aggregate's group, we could optimize it.
   Such as:
   `select max(a) from tbl group by a` will be optimized to `select a from tbl group by a`


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme commented on a change in pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

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



##########
File path: core/src/test/java/org/apache/calcite/tools/PlannerTest.java
##########
@@ -136,6 +136,20 @@ private void checkParseAndConvert(String query,
         + "    LogicalTableScan(table=[[hr, emps]])\n");
   }
 
+
+  @Test void test() throws Exception {

Review comment:
       Thanks for your remind.




-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme commented on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme commented on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1035967233


   > 
   
   @NobiGo Thanks for your reply.
   
   Common functions:
   sum(x) => x
   count(x) => 1
   avg(x) => x
   max(x) => x
   min(x) => x
   sum0(x) => x
   any_value(x) => x
   
   
   
   
   


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] xy2953396112 commented on a change in pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

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



##########
File path: core/src/test/java/org/apache/calcite/tools/PlannerTest.java
##########
@@ -136,6 +136,20 @@ private void checkParseAndConvert(String query,
         + "    LogicalTableScan(table=[[hr, emps]])\n");
   }
 
+
+  @Test void test() throws Exception {

Review comment:
       Unit test name is confused, please briefly describe the function of the test.
   
   




-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] NobiGo commented on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
NobiGo commented on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1034626732


   @wojustme Hi. I don't understand why Just MAX and MIN? If group by the A, then agg-call(A) can be simplify to A, if it is deterministic?


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme commented on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme commented on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1047367539


   Hi @NobiGo @xy2953396112 
   Please review this pr again.
   Thanks.


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme commented on a change in pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

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



##########
File path: core/src/test/java/org/apache/calcite/tools/PlannerTest.java
##########
@@ -136,6 +136,20 @@ private void checkParseAndConvert(String query,
         + "    LogicalTableScan(table=[[hr, emps]])\n");
   }
 
+
+  @Test void test() throws Exception {

Review comment:
       Delete 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.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme edited a comment on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme edited a comment on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1035967233


   > 
   
   @NobiGo Thanks for your reply.
   
   Common functions:
   avg(x) => x
   max(x) => x
   min(x) => x
   any_value(x) => x
   
   ---
   I will update this pr for these agg-calls, which could be simplified.
   
   
   


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme edited a comment on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme edited a comment on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1035967233


   > 
   
   @NobiGo Thanks for your reply.
   
   Common functions:
   sum(x) => x
   count(x) => case when x is not null then 1 else 0
   avg(x) => x
   max(x) => x
   min(x) => x
   sum0(x) => coalesce(x, 0)
   any_value(x) => x
   
   ---
   I will update this pr for these agg-calls, which could be simplified.
   
   
   


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme edited a comment on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme edited a comment on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1035967233


   > 
   
   @NobiGo Thanks for your reply.
   
   Common functions:
   sum(x) => x
   count(x) => 1 or 0
   avg(x) => x
   max(x) => x
   min(x) => x
   sum0(x) => coalesce(x, 0)
   any_value(x) => x
   
   ---
   I will update this pr for these agg-calls, which could be simplified.
   
   
   


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme edited a comment on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme edited a comment on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1035967233


   > 
   
   @NobiGo Thanks for your reply.
   
   Common functions:
   max(x) => x
   min(x) => x
   any_value(x) => x
   
   ---
   I will update this pr for these agg-calls, which could be simplified.
   
   
   


-- 
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-unsubscribe@calcite.apache.org

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



[GitHub] [calcite] wojustme edited a comment on pull request #2714: [CALCITE-5000] Expand `AGGREGATE_REDUCE_FUNCTIONS`, when arg of agg-call is in the aggregate's group

Posted by GitBox <gi...@apache.org>.
wojustme edited a comment on pull request #2714:
URL: https://github.com/apache/calcite/pull/2714#issuecomment-1035967233


   > 
   
   @NobiGo Thanks for your reply.
   
   Common functions:
   sum(x) => x
   count(x) => 1
   avg(x) => x
   max(x) => x
   min(x) => x
   sum0(x) => x
   any_value(x) => x
   
   --
   I will update this pr for these agg-calls, which could be simplified.
   
   
   


-- 
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-unsubscribe@calcite.apache.org

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