You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2020/06/04 08:33:38 UTC

[ignite] branch ignite-13021 created (now 3022cab)

This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a change to branch ignite-13021
in repository https://gitbox.apache.org/repos/asf/ignite.git.


      at 3022cab  WIP. debug.

This branch includes the following new commits:

     new b51ce31  WIP.
     new 3022cab  WIP. debug.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ignite] 01/02: WIP.

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a commit to branch ignite-13021
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit b51ce314e7f8f611b179ed38eeafc9ff8ddf699b
Author: Andrey V. Mashenkov <an...@gmail.com>
AuthorDate: Wed Jun 3 17:47:16 2020 +0300

    WIP.
---
 .../query/calcite/prepare/PlannerPhase.java        |   2 +
 .../calcite/rule/logical/LogicalOrToUnionRule.java |  82 ++++++
 .../query/calcite/rules/OrToUnionRuleTest.java     | 326 +++++++++++++++++++++
 .../ignite/testsuites/IgniteCalciteTestSuite.java  |   2 +
 4 files changed, 412 insertions(+)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java
index 2733e4a..220081b 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/PlannerPhase.java
@@ -41,6 +41,7 @@ import org.apache.ignite.internal.processors.query.calcite.rule.ValuesConverterR
 import org.apache.ignite.internal.processors.query.calcite.rule.logical.FilterJoinRule;
 import org.apache.ignite.internal.processors.query.calcite.rule.logical.LogicalFilterMergeRule;
 import org.apache.ignite.internal.processors.query.calcite.rule.logical.LogicalFilterProjectTransposeRule;
+import org.apache.ignite.internal.processors.query.calcite.rule.logical.LogicalOrToUnionRule;
 
 import static org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePrograms.cbo;
 import static org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePrograms.decorrelate;
@@ -89,6 +90,7 @@ public enum PlannerPhase {
                 TableModifyConverterRule.INSTANCE,
                 PushFilterIntoScanRule.FILTER_INTO_SCAN,
                 ProjectFilterTransposeRule.INSTANCE,
+                LogicalOrToUnionRule.INSTANCE,
                 UnionMergeRule.INSTANCE,
                 UnionConverterRule.INSTANCE,
                 UnionTraitsPropagationRule.INSTANCE,
diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java
new file mode 100644
index 0000000..e004f60
--- /dev/null
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.calcite.rule.logical;
+
+import java.util.Arrays;
+import java.util.List;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rel.core.RelFactories;
+import org.apache.calcite.rel.logical.LogicalFilter;
+import org.apache.calcite.rel.logical.LogicalUnion;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexUtil;
+import org.apache.ignite.internal.processors.query.calcite.rule.RuleUtils;
+
+public class LogicalOrToUnionRule extends RelOptRule {
+    public static final RelOptRule INSTANCE = new LogicalOrToUnionRule();
+
+    /**
+     *
+     */
+    public LogicalOrToUnionRule() {
+        super(
+            operand(LogicalFilter.class, any()),
+            RelFactories.LOGICAL_BUILDER, null);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onMatch(RelOptRuleCall call) {
+      /*
+      final LogicalFilter rel = call.rel(0);
+
+        final RexNode dnf = RexUtil.toDnf(rel.getCluster().getRexBuilder(), rel.getCondition());
+
+         final List<RexNode> operands = ((RexCall)dnf).getOperands();
+
+        final RelNode input = rel.getInput(0);
+
+        final LogicalUnion union1 =
+            LogicalUnion.create(Arrays.asList(
+                LogicalFilter.create(input, operands.get(0)),
+                LogicalFilter.create(input, RexUtil.andNot(rel.getCluster().getRexBuilder(), operands.get(1), operands.get(0)))), true);
+
+        final LogicalUnion union2 =
+            LogicalUnion.create(Arrays.asList(
+                LogicalFilter.create(input, operands.get(1)),
+                LogicalFilter.create(input, RexUtil.andNot(rel.getCluster().getRexBuilder(), operands.get(0), operands.get(1)))), true);
+
+        RuleUtils.transformTo(call, Arrays.asList(union1, union2));
+        */
+
+        final LogicalFilter rel = call.rel(0);
+
+        final RexNode dnf = RexUtil.toDnf(rel.getCluster().getRexBuilder(), rel.getCondition());
+
+        final List<RexNode> operands = ((RexCall)dnf).getOperands();
+
+        final LogicalUnion union1 =
+            LogicalUnion.create(Arrays.asList(
+                LogicalFilter.create(rel.getInput(0), operands.get(0)),
+                LogicalFilter.create(rel.getInput(0), operands.get(1))), false);
+
+        call.transformTo(union1);
+    }
+}
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
new file mode 100644
index 0000000..fb9d8c9
--- /dev/null
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
@@ -0,0 +1,326 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.query.calcite.rules;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.calcite.DataContext;
+import org.apache.calcite.config.CalciteConnectionConfig;
+import org.apache.calcite.linq4j.Enumerable;
+import org.apache.calcite.plan.Contexts;
+import org.apache.calcite.plan.ConventionTraitDef;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.plan.RelTraitDef;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.RelCollation;
+import org.apache.calcite.rel.RelCollationTraitDef;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelReferentialConstraint;
+import org.apache.calcite.rel.RelRoot;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeImpl;
+import org.apache.calcite.rel.type.RelProtoDataType;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.util.ImmutableBitSet;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.query.calcite.metadata.NodesMapping;
+import org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner;
+import org.apache.ignite.internal.processors.query.calcite.prepare.PlannerPhase;
+import org.apache.ignite.internal.processors.query.calcite.prepare.PlanningContext;
+import org.apache.ignite.internal.processors.query.calcite.rel.IgniteConvention;
+import org.apache.ignite.internal.processors.query.calcite.rel.IgniteTableScan;
+import org.apache.ignite.internal.processors.query.calcite.schema.IgniteIndex;
+import org.apache.ignite.internal.processors.query.calcite.schema.IgniteSchema;
+import org.apache.ignite.internal.processors.query.calcite.schema.IgniteTable;
+import org.apache.ignite.internal.processors.query.calcite.schema.TableDescriptor;
+import org.apache.ignite.internal.processors.query.calcite.trait.DistributionTraitDef;
+import org.apache.ignite.internal.processors.query.calcite.trait.IgniteDistribution;
+import org.apache.ignite.internal.processors.query.calcite.trait.IgniteDistributions;
+import org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeFactory;
+import org.apache.ignite.internal.processors.query.calcite.type.IgniteTypeSystem;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.apache.calcite.tools.Frameworks.createRootSchema;
+import static org.apache.calcite.tools.Frameworks.newConfigBuilder;
+import static org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.FRAMEWORK_CONFIG;
+
+public class OrToUnionRuleTest extends GridCommonAbstractTest {
+    /** */
+    private List<UUID> nodes;
+
+    /** */
+    @Before
+    public void setup() {
+        nodes = new ArrayList<>(4);
+
+        for (int i = 0; i < 4; i++)
+            nodes.add(UUID.randomUUID());
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testDistinctOrToUnionAllRewrite() throws Exception {
+        IgniteTypeFactory f = new IgniteTypeFactory(IgniteTypeSystem.INSTANCE);
+
+        TestTable products = new TestTable(
+            new RelDataTypeFactory.Builder(f)
+                .add("ID", f.createJavaType(Integer.class))
+                .add("CATEGORY", f.createJavaType(String.class))
+                .add("SUBCATEGORY", f.createJavaType(String.class))
+                .add("CATALOG_ID", f.createJavaType(Integer.class)) // Affinity key.
+                .build()) {
+
+            @Override public IgniteDistribution distribution() {
+                return IgniteDistributions.broadcast();
+            }
+        };
+
+        IgniteSchema publicSchema = new IgniteSchema("PUBLIC");
+
+        publicSchema.addTable("PRODUCTS", products);
+
+        SchemaPlus schema = createRootSchema(false)
+            .add("PUBLIC", publicSchema);
+
+            String sql = "SELECT *" +
+                "FROM products " +
+                "WHERE category = 'Photo' " +
+                "OR subcategory ='Camera Media'";
+//                "WHERE (category = 'Photo' OR category = ?)" +
+//                "AND (subcategory ='Camera Media' OR subcategory = ?)";
+
+        RelTraitDef<?>[] traitDefs = {
+            DistributionTraitDef.INSTANCE,
+            ConventionTraitDef.INSTANCE,
+            RelCollationTraitDef.INSTANCE
+
+        };
+
+        PlanningContext ctx = PlanningContext.builder()
+            .localNodeId(F.first(nodes))
+            .originatingNodeId(F.first(nodes))
+            .parentContext(Contexts.empty())
+            .frameworkConfig(newConfigBuilder(FRAMEWORK_CONFIG)
+                .defaultSchema(schema)
+                .traitDefs(traitDefs)
+                .build())
+            .logger(log)
+            .query(sql)
+            .topologyVersion(AffinityTopologyVersion.NONE)
+            .build();
+
+        RelRoot relRoot;
+
+        try (IgnitePlanner planner = ctx.planner()) {
+            assertNotNull(planner);
+
+            String qry = ctx.query();
+
+            assertNotNull(qry);
+
+            // Parse
+            SqlNode sqlNode = planner.parse(qry);
+
+            // Validate
+            sqlNode = planner.validate(sqlNode);
+
+            // Convert to Relational operators graph
+            relRoot = planner.rel(sqlNode);
+
+            RelNode rel = relRoot.rel;
+
+            System.out.println(RelOptUtil.toString(rel));
+            assertNotNull(rel);
+            assertEquals("LogicalProject(ID=[$0], CATEGORY=[$1], SUBCATEGORY=[$2], CATALOG_ID=[$3])\n" +
+                    "  LogicalFilter(condition=[OR(=(CAST($1):VARCHAR, 'Photo'), =(CAST($2):VARCHAR, 'Camera Media'))])\n" +
+                    "    IgniteTableScan(table=[[PUBLIC, PRODUCTS]], index=[PK], lower=[[]], upper=[[]], collation=[[]])\n",
+                RelOptUtil.toString(rel));
+
+            // Transformation chain
+            RelTraitSet desired = rel.getCluster().traitSet()
+                .replace(IgniteConvention.INSTANCE)
+                .replace(IgniteDistributions.single())
+                .simplify();
+
+            RelNode phys = planner.transform(PlannerPhase.OPTIMIZATION, desired, rel);
+
+            assertNotNull(phys);
+            assertEquals("IgniteProject(DEPTNO=[$0], DEPTNO0=[$4])\n" +
+                    "  IgniteJoin(condition=[=(+($0, 10), *($4, 2))], joinType=[inner])\n" +
+                    "    IgniteTableScan(table=[[PUBLIC, DEPT]], index=[PK], lower=[[]], upper=[[]], collation=[[]])\n" +
+                    "    IgniteTableScan(table=[[PUBLIC, EMP]], index=[PK], lower=[[]], upper=[[]], collation=[[]])\n",
+                RelOptUtil.toString(phys));
+        }
+    }
+
+
+    /** */
+    private abstract static class TestTable implements IgniteTable {
+        /** */
+        private final RelProtoDataType protoType;
+
+        /** */
+        private final Map<String, IgniteIndex> indexes = new HashMap<>();
+
+        /** */
+        private TestTable(RelDataType type) {
+            protoType = RelDataTypeImpl.proto(type);
+
+            addIndex(new IgniteIndex(null, "PK", null, this));
+        }
+
+        /** {@inheritDoc} */
+        @Override public RelNode toRel(RelOptTable.ToRelContext ctx, RelOptTable relOptTbl) {
+            RelOptCluster cluster = ctx.getCluster();
+            RelTraitSet traitSet = cluster.traitSetOf(IgniteConvention.INSTANCE)
+                .replaceIfs(RelCollationTraitDef.INSTANCE, this::collations)
+                .replaceIf(DistributionTraitDef.INSTANCE, this::distribution);
+
+            return new IgniteTableScan(cluster, traitSet, relOptTbl, "PK", null);
+        }
+
+        /** {@inheritDoc} */
+        @Override public IgniteTableScan toRel(RelOptCluster cluster, RelOptTable relOptTbl, String idxName) {
+            RelTraitSet traitSet = cluster.traitSetOf(IgniteConvention.INSTANCE)
+                .replaceIfs(RelCollationTraitDef.INSTANCE, this::collations)
+                .replaceIf(DistributionTraitDef.INSTANCE, this::distribution);
+
+            return new IgniteTableScan(cluster, traitSet, relOptTbl, "PK", null);
+        }
+
+        /** {@inheritDoc} */
+        @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) {
+            return protoType.apply(typeFactory);
+        }
+
+        /** {@inheritDoc} */
+        @Override public Statistic getStatistic() {
+            return new Statistic() {
+                /** {@inheritDoc */
+                @Override public Double getRowCount() {
+                    return 100.0;
+                }
+
+                /** {@inheritDoc */
+                @Override public boolean isKey(ImmutableBitSet cols) {
+                    return false;
+                }
+
+                /** {@inheritDoc */
+                @Override public List<ImmutableBitSet> getKeys() {
+                    throw new AssertionError();
+                }
+
+                /** {@inheritDoc */
+                @Override public List<RelReferentialConstraint> getReferentialConstraints() {
+                    throw new AssertionError();
+                }
+
+                /** {@inheritDoc */
+                @Override public List<RelCollation> getCollations() {
+                    return Collections.emptyList();
+                }
+
+                /** {@inheritDoc */
+                @Override public RelDistribution getDistribution() {
+                    throw new AssertionError();
+                }
+            };
+        }
+
+        /** {@inheritDoc} */
+        @Override public Enumerable<Object[]> scan(DataContext root, List<RexNode> filters, int[] projects) {
+            throw new AssertionError();
+        }
+
+
+        /** {@inheritDoc} */
+        @Override public Schema.TableType getJdbcTableType() {
+            throw new AssertionError();
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean isRolledUp(String col) {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent,
+            CalciteConnectionConfig config) {
+            throw new AssertionError();
+        }
+
+        /** {@inheritDoc} */
+        @Override public NodesMapping mapping(PlanningContext ctx) {
+            throw new AssertionError();
+        }
+
+        /** {@inheritDoc} */
+        @Override public IgniteDistribution distribution() {
+            throw new AssertionError();
+        }
+
+        /** {@inheritDoc} */
+        @Override public List<RelCollation> collations() {
+            return Collections.emptyList();
+        }
+
+        /** {@inheritDoc} */
+        @Override public TableDescriptor descriptor() {
+            throw new AssertionError();
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<String, IgniteIndex> indexes() {
+            return indexes;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void addIndex(IgniteIndex idxTbl) {
+            indexes.put(idxTbl.name(), idxTbl);
+        }
+
+        /** {@inheritDoc} */
+        @Override public IgniteIndex getIndex(String idxName) {
+            return indexes.get(idxName);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void removeIndex(String idxName) {
+            throw new AssertionError();
+        }
+    }
+}
diff --git a/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java b/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java
index 48818c8..b823ddd 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/testsuites/IgniteCalciteTestSuite.java
@@ -19,6 +19,7 @@ package org.apache.ignite.testsuites;
 
 import org.apache.ignite.internal.processors.query.calcite.CalciteBasicSecondaryIndexIntegrationTest;
 import org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessorTest;
+import org.apache.ignite.internal.processors.query.calcite.rules.OrToUnionRuleTest;
 import org.apache.ignite.internal.processors.query.calcite.PlannerTest;
 import org.apache.ignite.internal.processors.query.calcite.exec.ClosableIteratorsHolderTest;
 import org.apache.ignite.internal.processors.query.calcite.exec.rel.ContinuousExecutionTest;
@@ -33,6 +34,7 @@ import org.junit.runners.Suite;
 @RunWith(Suite.class)
 @Suite.SuiteClasses({
     PlannerTest.class,
+    OrToUnionRuleTest.class,
     ExecutionTest.class,
     ClosableIteratorsHolderTest.class,
     ContinuousExecutionTest.class,


[ignite] 02/02: WIP. debug.

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a commit to branch ignite-13021
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 3022cab2a0667c1b8c6d39b4a5a691706d30e672
Author: Andrey V. Mashenkov <an...@gmail.com>
AuthorDate: Thu Jun 4 11:32:06 2020 +0300

    WIP. debug.
---
 .../calcite/rule/logical/LogicalOrToUnionRule.java     | 18 +++++++++++++-----
 .../query/calcite/rules/OrToUnionRuleTest.java         |  5 +----
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java
index e004f60..4aff453 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rule/logical/LogicalOrToUnionRule.java
@@ -21,6 +21,7 @@ import java.util.Arrays;
 import java.util.List;
 import org.apache.calcite.plan.RelOptRule;
 import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptUtil;
 import org.apache.calcite.rel.core.RelFactories;
 import org.apache.calcite.rel.logical.LogicalFilter;
 import org.apache.calcite.rel.logical.LogicalUnion;
@@ -72,11 +73,18 @@ public class LogicalOrToUnionRule extends RelOptRule {
 
         final List<RexNode> operands = ((RexCall)dnf).getOperands();
 
-        final LogicalUnion union1 =
-            LogicalUnion.create(Arrays.asList(
-                LogicalFilter.create(rel.getInput(0), operands.get(0)),
-                LogicalFilter.create(rel.getInput(0), operands.get(1))), false);
+        final LogicalFilter filter1 = LogicalFilter.create(rel.getInput(), operands.get(0));
+        final LogicalFilter filter2 = LogicalFilter.create(rel.getInput(), operands.get(1));
+
+        final LogicalUnion union = LogicalUnion.create(
+            Arrays.asList(
+                filter1,
+                filter2), false);
+
+        System.out.println("Filter 1: "+filter1.getRowType());
+        System.out.println("Filter 2: "+filter2.getRowType());
+        System.out.println("Union: "+union.getRowType());
 
-        call.transformTo(union1);
+        RuleUtils.transformTo(call, union);
     }
 }
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
index fb9d8c9..504af4a 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/rules/OrToUnionRuleTest.java
@@ -178,10 +178,7 @@ public class OrToUnionRuleTest extends GridCommonAbstractTest {
             RelNode phys = planner.transform(PlannerPhase.OPTIMIZATION, desired, rel);
 
             assertNotNull(phys);
-            assertEquals("IgniteProject(DEPTNO=[$0], DEPTNO0=[$4])\n" +
-                    "  IgniteJoin(condition=[=(+($0, 10), *($4, 2))], joinType=[inner])\n" +
-                    "    IgniteTableScan(table=[[PUBLIC, DEPT]], index=[PK], lower=[[]], upper=[[]], collation=[[]])\n" +
-                    "    IgniteTableScan(table=[[PUBLIC, EMP]], index=[PK], lower=[[]], upper=[[]], collation=[[]])\n",
+            assertEquals("",
                 RelOptUtil.toString(phys));
         }
     }