[
https://issues.apache.org/jira/browse/CALCITE-7390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18053525#comment-18053525
]
lincoln lee commented on CALCITE-7390:
--------------------------------------
[~mbudiu] I verified the following case only keep select caluse of yours, seems
works fine:
{code}
@Test void testProjectToWindowRule() {
HepProgramBuilder builder = new HepProgramBuilder();
builder.addRuleClass(ProjectToWindowRule.class);
HepPlanner hepPlanner = new HepPlanner(builder.build());
final String sql = "select count(*) over (order by empno) empno from emp";
sql(sql).withPlanner(hepPlanner)
.withRule(
CoreRules.PROJECT_TO_LOGICAL_PROJECT_AND_WINDOW,
// either include the transpose rule
CoreRules.PROJECT_WINDOW_TRANSPOSE
)
.check();
}
{code}
compiled plan without CoreRules.PROJECT_WINDOW_TRANSPOSE:
{code}
LogicalProject(EMPNO=[$9])
LogicalWindow(window#0=[window(order by [0] aggs [COUNT()])])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
{code}
compiled plan with CoreRules.PROJECT_WINDOW_TRANSPOSE:
{code}
LogicalProject(EMPNO=[$1])
LogicalWindow(window#0=[window(order by [0] aggs [COUNT()])])
LogicalProject(EMPNO=[$0])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
{code}
> Types generated for Window can contain multiple fields with the same name
> -------------------------------------------------------------------------
>
> Key: CALCITE-7390
> URL: https://issues.apache.org/jira/browse/CALCITE-7390
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.42
> Reporter: Mihai Budiu
> Priority: Minor
>
> As a result of CALCITE-7375 some LogicalWindow operations can have types with
> duplicate names.
> [~lincoln.86xy] you have introduced this change.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)