You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Rui Wang (JIRA)" <ji...@apache.org> on 2019/02/05 21:12:00 UTC

[jira] [Assigned] (BEAM-4522) Re-enable CalcRemoveRule

     [ https://issues.apache.org/jira/browse/BEAM-4522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rui Wang reassigned BEAM-4522:
------------------------------

    Assignee: Rui Wang

> Re-enable CalcRemoveRule
> ------------------------
>
>                 Key: BEAM-4522
>                 URL: https://issues.apache.org/jira/browse/BEAM-4522
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Kenneth Knowles
>            Assignee: Rui Wang
>            Priority: Major
>
> BEAM-4449 replaces our use of {{Project}} and {{Filter}} with a compound operation {{Calc}} via these rules:
>  - FilterToCalcRule.INSTANCE,
>  - ProjectToCalcRule.INSTANCE,
> Which then allows these optimizations:
>  - FilterCalcMergeRule.INSTANCE,
>  - ProjectCalcMergeRule.INSTANCE,
>  - CalcRemoveRule.INSTANCE,
>  - CalcMergeRule.INSTANCE,
> This always hits assertion errors in the VolcanoPlanner when CalcRemoveRule is invoked, because: 
>  - LogicalCalc.create always results in a composite collation trait
>  - VolcanoPlanner asserts that there are no composite traits
>  - There's no simplify() in between the two (I'm not sure there can be)
> The stack trace (Calcite 1.16.0) is this:
> java.lang.AssertionError
> 	at org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraits(VolcanoPlanner.java:546)
> 	at org.apache.calcite.plan.RelOptRule.convert(RelOptRule.java:540)
> 	at org.apache.calcite.rel.rules.CalcRemoveRule.onMatch(CalcRemoveRule.java:65)
> 	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:212)
> 	at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:650)
> 	at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:368)
> 	at org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:336)
> 	at  org.apache.beam.sdk.extensions.sql.impl.BeamQueryPlanner.convertToBeamRel(BeamQueryPlanner.java:135)
> We can actually make progress by disabling CalcRemoveRule in a couple of places. Filing this ticket to track turning it back on since there is no real reason we shouldn't have it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)