[ https://issues.apache.org/jira/browse/CALCITE-2223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16753181#comment-16753181 ]
Vladimir Sitnikov commented on CALCITE-2223: -------------------------------------------- [~vvysotskyi], I've relaxed cycleDetector by allowing "Converter" relations to form cycles. I've no idea how much sense does it make to have cycles that include Converters, but It does seem to fix CannotPlanException. Would you please check? (the branch is the same) By the way, I get a number of "Failed to connect" exceptions when running {{mvn install}} for Drill project. Is it expected? PS. Do you think there's a relevant subset of Drill's tests that we can run in Calcite's Travis job when validating PRs? Apparently Drill has interesting cases. {noformat} Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31013 at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:218) [netty-transport-4.0.48.Final.jar:4.0.48.Final] ... 6 common frames omitted 23:43:10.145 [main] ERROR o.a.drill.exec.client.DrillClient - Attempt 1: Failed to connect to server 192.168.88.243:31010 23:43:10.150 [main] ERROR o.a.drill.exec.client.DrillClient - Attempt 1: Failed to connect to server 192.168.88.243:31013 [INFO] Running org.apache.drill.TestPlanVerificationUtilities [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 s <<< FAILURE! - in org.apache.drill.TestPlanVerificationUtilities [ERROR] org.apache.drill.TestPlanVerificationUtilities Time elapsed: 0.001 s <<< ERROR! org.apache.drill.exec.rpc.RpcException: CONNECTION : io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31010 Caused by: java.util.concurrent.ExecutionException: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31010 Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31010 [INFO] Running org.apache.drill.TestFunctionsWithTypeExpoQueries [ERROR] Tests run: 2, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 0.001 s <<< FAILURE! - in org.apache.drill.TestFunctionsWithTypeExpoQueries [ERROR] org.apache.drill.TestFunctionsWithTypeExpoQueries Time elapsed: 0 s <<< ERROR! org.apache.drill.exec.rpc.RpcException: CONNECTION : io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31013 Caused by: java.util.concurrent.ExecutionException: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31013 Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.88.243:31013 [ERROR] org.apache.drill.TestFunctionsWithTypeExpoQueries Time elapsed: 0 s <<< FAILURE! java.lang.AssertionError: Failed to reset session option `planner.enable_limit0_optimization`, Error: java.lang.NullPointerException at org.apache.drill.TestFunctionsWithTypeExpoQueries.tearDown(TestFunctionsWithTypeExpoQueries.java:48){noformat} > ProjectMergeRule is infinitely matched when is applied after > ProjectReduceExpressionsRule > ----------------------------------------------------------------------------------------- > > Key: CALCITE-2223 > URL: https://issues.apache.org/jira/browse/CALCITE-2223 > Project: Calcite > Issue Type: Bug > Reporter: Volodymyr Vysotskyi > Assignee: Julian Hyde > Priority: Critical > Attachments: heap_overview.png, provenance_contents.png > > > For queries like this: > {code:sql} > select t1.f from (select cast(f as int) f, f from (select cast(f as int) f > from (values('1')) t(f))) as t1 > {code} > OOM is thrown when {{ProjectMergeRule}} is applied before applying > {{ProjectReduceExpressionsRule}} in VolcanoPlanner. > A simple test to reproduce this issue (in {{RelOptRulesTest}}): > {code:java} > @Test public void testOomProjectMergeRule() { > RelBuilder relBuilder = > RelBuilder.create(RelBuilderTest.config().build()); > RelNode relNode = relBuilder > .values(new String[]{"f"}, "1") > .project( > relBuilder.alias( > relBuilder.cast(relBuilder.field(0), SqlTypeName.INTEGER), > "f")) > .project( > relBuilder.alias( > relBuilder.cast(relBuilder.field(0), SqlTypeName.INTEGER), > "f0"), > relBuilder.alias(relBuilder.field(0), "f")) > .project( > relBuilder.alias(relBuilder.field(0), "f")) > .build(); > RelOptPlanner planner = relNode.getCluster().getPlanner(); > RuleSet ruleSet = > RuleSets.ofList( > ReduceExpressionsRule.PROJECT_INSTANCE, > new ProjectMergeRuleWithLongerName(), > EnumerableRules.ENUMERABLE_PROJECT_RULE, > EnumerableRules.ENUMERABLE_VALUES_RULE); > Program program = Programs.of(ruleSet); > RelTraitSet toTraits = > relNode.getCluster().traitSet() > .replace(0, EnumerableConvention.INSTANCE); > RelNode output = program.run(planner, relNode, toTraits, > ImmutableList.<RelOptMaterialization>of(), > ImmutableList.<RelOptLattice>of()); > // check for output > } > /** > * ProjectMergeRule inheritor which has > * class name greater than ProjectReduceExpressionsRule class name > (String.compareTo()). > * > * It is needed for RuleQueue.popMatch() method > * to apply this rule before ProjectReduceExpressionsRule. > */ > private static class ProjectMergeRuleWithLongerName extends > ProjectMergeRule { > public ProjectMergeRuleWithLongerName() { > super(true, RelFactories.LOGICAL_BUILDER); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)