You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/03/01 00:46:00 UTC
[jira] [Updated] (CALCITE-2883) HepPlanner subprogram may loop till
getting out of memory
[ https://issues.apache.org/jira/browse/CALCITE-2883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-2883:
------------------------------------
Labels: pull-request-available (was: )
> HepPlanner subprogram may loop till getting out of memory
> ---------------------------------------------------------
>
> Key: CALCITE-2883
> URL: https://issues.apache.org/jira/browse/CALCITE-2883
> Project: Calcite
> Issue Type: Bug
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Priority: Major
> Labels: pull-request-available
>
> Consider the following two hep programs.
> Program 1:
> {code}
> final HepProgramBuilder programBuilder = new HepProgramBuilder();
> programBuilder.addMatchOrder(HepMatchOrder.BOTTOM_UP);
> programBuilder.addRuleInstance(JoinToMultiJoinRule.INSTANCE);
> programBuilder.addRuleInstance(LoptOptimizeJoinRule.INSTANCE);
> final HepProgram program = programBuilder.build();
> {code}
> Program 2:
> {code}
> final HepProgramBuilder programBuilder = new HepProgramBuilder();
> final HepProgramBuilder subprogramBuilder = new HepProgramBuilder();
> subprogramBuilder.addMatchOrder(HepMatchOrder.BOTTOM_UP);
> subprogramBuilder.addRuleInstance(JoinToMultiJoinRule.INSTANCE);
> subprogramBuilder.addRuleInstance(LoptOptimizeJoinRule.INSTANCE);
> programBuilder.addSubprogram(subprogramBuilder.build());
> final HepProgram program = programBuilder.build();
> {code}
> I would expect both programs to behave similarly. However, program 2 will loop indefinitely. The reason is that {{HepPlanner}} subprogram execution loops if subprogram generates any new expression.
> https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java#L339
> This does not seem right since planner can control exiting the program (and thus, subprogram) depending on its own internal state and configuration properties, e.g., match limit.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)