[
https://issues.apache.org/jira/browse/CALCITE-4540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17303642#comment-17303642
]
Julian Hyde commented on CALCITE-4540:
--------------------------------------
The general practice for sub-classes of {{RelNode}} is that the constructor is
package-private (or public but marked "do not use"), and there is a {{public
static create}} method. {{EnumerableSort}} is a good example.
We should add a {{create}} method to {{EnumerableWindow}}.
Also, we should add a factory for {{Window}} (compare
{{RelFactories.SortFactory}}), implementations for common conventions (compare
{{RelFactories.SortFactoryImpl}} and
{{EnumerableRelFactories.SortFactoryImpl}}), and a method (or methods) in
{{RelBuilder}} to create a {{Window}} (compare {{RelBuilder.sort}}).
I think this would solve the problem of {{EnumerableWindow#copy}}:
{{RelBuilder.window}} would create a {{Window}} (of the appropriate type based
on its {{RelFactory}}) from the raw ingredients, and derive the correct traits,
row type, etc. You could call the {{window}} method with the attributes of your
existing {{EnumerableWindow}}.
> The constructor of EnumerableWindow should be public
> ----------------------------------------------------
>
> Key: CALCITE-4540
> URL: https://issues.apache.org/jira/browse/CALCITE-4540
> Project: Calcite
> Issue Type: Task
> Reporter: Thomas Rebele
> Priority: Minor
>
> For some use cases it is necessary to change the row type of the window (see
> CALCITE-4530).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)