[ 
https://issues.apache.org/jira/browse/CALCITE-2658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16708091#comment-16708091
 ] 

Julian Hyde commented on CALCITE-2658:
--------------------------------------

Reviewing PR 912 WindowReduceExpressionsRule:
* Can you please split either 912 or 921 into a separate JIRA case?
* The code looks good, but the test case only tests removing ORDER BY keys if 
they are already in PARTITION BY. It doesn't test constant reduction. Can you 
add a test for that?
* I think you should add the rule to 
CalcitePrepareImpl.CONSTANT_REDUCTION_RULES, alongside the likes of 
ReduceExpressionsRule.CALC_INSTANCE, so that the rule will be applied by 
default.

> Introducing more ReduceExpressionRules
> --------------------------------------
>
>                 Key: CALCITE-2658
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2658
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Chunwei Lei
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.18.0
>
>
> It is useful to have rules reducing Exchange/Sort/SortExchange keys, e.g.,
> SELECT key,value FROM (SELECT 1 AS key, value FROM src) r DISTRIBUTE BY key;
> can be reduced to 
> SELECT 1 AS key, value FROM src;    # Since singleton requirement may already 
> required by SELECT.
> SELECT key,value FROM (SELECT 1 AS key, value FROM src) r ORDER BY key;
> can be reduced to
> SELECT 1 AS key, value FROM src;    # Since ordering on constant is useless.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to