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

Julian Hyde commented on CALCITE-4073:
--------------------------------------

My intuition is that there is not 'one true normalization' that is good for all 
cases. Therefore I am generally against converting RexNodes to 'normalized 
form' because it pre-supposes that there is such a form.

I am worried that people start using this class to normalize differently in 
different contexts.

I am also worried that someone will add a configuration parameter so that 
different projects can normalize in different ways.

Both of these changes would cause our corpus of planner rules to become more 
flaky, because the rules would make assumptions that may not apply in the 
current normalization scheme.

I will not veto this change but I need to hear everyone commit to the 
philosophy that Calcite will have at most one normalization scheme, in all 
circumstances and contexts.

> Add a new component RexNormalize for more effect rex nodes normalization
> ------------------------------------------------------------------------
>
>                 Key: CALCITE-4073
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4073
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.24.0
>            Reporter: Danny Chen
>            Assignee: Danny Chen
>            Priority: Major
>             Fix For: 1.24.0
>
>
> Currently, we only have simple normalization such as:
> $2 = $1 => $1 = $2
> $2 > $1 => $1 < $2
> we can extend the logic to more like:
> - put the complex predicates behind, like OR(OR(udf($1), $2), $3) => OR($3, 
> OR(udf($1), $2))
> - put the udf operand behind, like OR(udf($1), $2) => OR($2, udf($1))
> - put the local variables that appears more frequently in the front, which is 
> more user-friendly to code generation because the variable can be cached and 
> reused.
> Also note that, we should allows flexible configuration for switch this 
> function on/off(not a system calcite property now) for downstream users and 
> projects(because the normalization may have some performance trade-off).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to