[ https://issues.apache.org/jira/browse/CALCITE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16806333#comment-16806333 ]
Chunwei Lei edited comment on CALCITE-2964 at 4/1/19 2:22 AM: -------------------------------------------------------------- I debugged a little since it is a little weird. I find that it generates a Filter instead of Project when copyProject is false using RelBuilder in that it is a trivial project[1]. [1][https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L1327] was (Author: chunwei lei): I debugged a little since it is a little weird. I find that it generates a Filter instead of Project when copyProject is false in that it is a trivial project[1]. [1][https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L1327] > testEmptyFilterProjectUnion fails when copyPorject is disabled in > FilterProjectTransposeRule > -------------------------------------------------------------------------------------------- > > Key: CALCITE-2964 > URL: https://issues.apache.org/jira/browse/CALCITE-2964 > Project: Calcite > Issue Type: Bug > Components: core > Reporter: Haisheng Yuan > Priority: Major > > Changing > {code:java} > public static final FilterProjectTransposeRule INSTANCE = > new FilterProjectTransposeRule(Filter.class, Project.class, true, true, > RelFactories.LOGICAL_BUILDER); > {code} > to > {code:java} > public static final FilterProjectTransposeRule INSTANCE = > new FilterProjectTransposeRule(Filter.class, Project.class, true, false, > RelFactories.LOGICAL_BUILDER); > {code} > will cause testEmptyFilterProjectUnion plan diff: > {code:java} > LogicalProject(X=[$0], Y=[$1]) > LogicalUnion(all=[true]) > LogicalFilter(condition=[>(+($0, $1), 30)]) > LogicalValues(tuples=[[{ 10, 1 }, { 30, 3 }]]) > LogicalFilter(condition=[>(+($0, $1), 30)]) > LogicalValues(tuples=[[{ 20, 2 }]]) > {code} > The expected plan is: > {code:java} > LogicalProject(X=[$0], Y=[$1]) > LogicalValues(tuples=[[{ 30, 3 }]]) > {code} > I am assuming it will generate the same plan no matter copyFilter/copyProject > is on or off. Is this wrong assumption? -- This message was sent by Atlassian JIRA (v7.6.3#76005)