[
https://issues.apache.org/jira/browse/CALCITE-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17140691#comment-17140691
]
Julian Hyde commented on CALCITE-4071:
--------------------------------------
[~hyuan] See if you can remove the current uses. Some uses might be hard. For
example, in HepPlanner, if we don't update the input, we may need to copy the
entire tree.
There's an old joke where a functional programmer needs to change a light
bulb... and does it by making a copy of the house to surround the new light
bulb, then making a copy of the continent that contains the house.
The point of the joke is that immutable data structures need a few mutable
'junction points'. This may be one of those.
Still, if you can remove most of the current uses and mark the method
deprecated, that would be progress.
> Make RelNode Immutable
> ----------------------
>
> Key: CALCITE-4071
> URL: https://issues.apache.org/jira/browse/CALCITE-4071
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Haisheng Yuan
> Priority: Major
>
> Currently, RelNode is mutable, mainly in planner. That makes planner code
> error-prone, hard to maintain, and complicate the logic. Let's try to avoid
> using {{replaceInput}}, at least inside planner, and see if we can deprecate
> {{replaceInput}}. That will make planner more robust.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)