You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chunwei Lei (JIRA)" <ji...@apache.org> on 2019/04/01 02:22:00 UTC
[jira] [Commented] (CALCITE-2964) testEmptyFilterProjectUnion fails
when copyPorject is disabled in FilterProjectTransposeRule
[ https://issues.apache.org/jira/browse/CALCITE-2964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16806333#comment-16806333 ]
Chunwei Lei commented on CALCITE-2964:
--------------------------------------
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)