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

Maryann Xue edited comment on CALCITE-1637 at 2/16/17 7:41 AM:
---------------------------------------------------------------

The problem is that mutable rels are now only used by materialized view 
substitution. So it would be good to keep access to these classes as limited as 
possible, package or protected. The reason why I suggest moving the mutable rel 
classes into a separate file is that SubsitutionVisitor now looks a little 
chaotic to me, having both MutableRel classes and UnifyRule classes and a lot 
of utility methods, and will be even heavier once we add all these missing 
mutable rels. At this point, I think it might be good enough to keep all 
MutableRel classes and utility methods in one single file since each of these 
classes is relatively light. And another thing is that it doesn't seem 
necessary to have MaterializedViewSubstitutionVisitor since it simply contains 
a extended set of unify rules and meanwhile SubstitutionVisitor is not used or 
derived by any class other than MaterializedViewSubstitutionVisitor. So what 
I'm thinking right now is that all this stuff can be organized into two files:
1. XXXSubstitutionVisitor which contains a set of unify rules and the methods 
that does materialization substitution (i.e. {{go}})
2. MutableRels which has all the mutable rel classes and the utility methods 
related to mutable rels (e.g. {{toMutable}}, {{fromMutable}}, etc)


was (Author: maryannxue):
The problem is that mutable rels are now only used by materialized view 
substitution. So it would be good to keep access to these classes as limited as 
possible, package or protected. The reason why I suggest moving the mutable rel 
classes into a separate file is that SubsitutionVisitor now looks a little 
chaotic to me, having too many both MutableRel classes and UnifyRule classes 
and a lot of utility methods, and will be even heavier once we add all these 
missing mutable rels. At this point, I think it might be good enough to keep 
all MutableRel classes and utility methods in one single file since each of 
these classes is relatively light. And another thing is that it doesn't seem 
necessary to have MaterializedViewSubstitutionVisitor since it simply contains 
a extended set of unify rules and meanwhile SubstitutionVisitor is not used or 
derived by any class other than MaterializedViewSubstitutionVisitor. So what 
I'm thinking right now is that all this stuff can be organized into two files:
1. XXXSubstitutionVisitor which contains a set of unify rules and the methods 
that does materialization substitution (i.e. {{go}})
2. MutableRels which has all the mutable rel classes and the utility methods 
related to mutable rels (e.g. {{toMutable}}, {{fromMutable}}, etc)

> Add missing MutableRels for all relational expressions
> ------------------------------------------------------
>
>                 Key: CALCITE-1637
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1637
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.11.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>             Fix For: 1.12.0
>
>
> Missing MutableRels include:
> MutableCalc,
> MutableCollect,
> MutableCorrelate,
> MutableExchange,
> MutableIntersect,
> MutableMinus,
> MutableSample,
> MutableSemiJoin,
> MutableTableFunctionScan,
> MutableTableModify,
> MutableUncollect,
> MutableWindow



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to