diff --git a/cassandra/pom.xml b/cassandra/pom.xml index 52e2125f4bda..e527099d0658 100644 --- a/cassandra/pom.xml +++ b/cassandra/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-cassandra jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Cassandra Cassandra adapter for Calcite diff --git a/core/pom.xml b/core/pom.xml index 3df2ca4c1a5f..b4f7c912ab16 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-core jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Core Core Calcite APIs and engine. diff --git a/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule.java index 118d71d0eb85..3cab19967a87 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule.java @@ -22,6 +22,7 @@ import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.Join; +import org.apache.calcite.rel.core.JoinRelType; import org.apache.calcite.rel.core.RelFactories; import org.apache.calcite.rel.core.TableScan; import org.apache.calcite.rel.logical.LogicalJoin; @@ -106,6 +107,12 @@ private void onMatchRight(RelOptRuleCall call) { // return; // } + // right join cannot be pushed through inner + if (topJoin.getJoinType() == JoinRelType.RIGHT + && bottomJoin.getJoinType() == JoinRelType.INNER) { + return; + } + // Split the condition of topJoin into a conjunction. Each of the // parts that does not use columns from B can be pushed down. final List intersecting = new ArrayList<>(); @@ -142,7 +149,7 @@ private void onMatchRight(RelOptRuleCall call) { RexNode newBottomCondition = RexUtil.composeConjunction(rexBuilder, newBottomList, false); final Join newBottomJoin = bottomJoin.copy(bottomJoin.getTraitSet(), - newBottomCondition, relA, relC, bottomJoin.getJoinType(), bottomJoin.isSemiJoinDone()); + newBottomCondition, relA, relC, topJoin.getJoinType(), bottomJoin.isSemiJoinDone()); // target: | A | C | B | // source: | A | B | C | @@ -157,7 +164,7 @@ private void onMatchRight(RelOptRuleCall call) { RexNode newTopCondition = RexUtil.composeConjunction(rexBuilder, newTopList, false); @SuppressWarnings("SuspiciousNameCombination") final Join newTopJoin = topJoin.copy(topJoin.getTraitSet(), newTopCondition, newBottomJoin, - relB, topJoin.getJoinType(), topJoin.isSemiJoinDone()); + relB, bottomJoin.getJoinType(), topJoin.isSemiJoinDone()); assert !Mappings.isIdentity(topMapping); final RelBuilder relBuilder = call.builder(); diff --git a/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule2.java b/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule2.java index 384e658c0bf1..14539f07858b 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule2.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/OLAPJoinPushThroughJoinRule2.java @@ -23,6 +23,7 @@ import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.Join; +import org.apache.calcite.rel.core.JoinRelType; import org.apache.calcite.rel.core.Project; import org.apache.calcite.rel.core.RelFactories; import org.apache.calcite.rel.core.TableScan; @@ -136,6 +137,12 @@ private void onMatchRight(RelOptRuleCall call) { // return; // } + // right join cannot be pushed through inner + if (topJoin.getJoinType() == JoinRelType.RIGHT + && bottomJoin.getJoinType() == JoinRelType.INNER) { + return; + } + // Split the condition of topJoin into a conjunction. Each of the // parts that does not use columns from B can be pushed down. final List intersecting = new ArrayList<>(); @@ -168,7 +175,7 @@ private void onMatchRight(RelOptRuleCall call) { final RexBuilder rexBuilder = cluster.getRexBuilder(); RexNode newBottomCondition = RexUtil.composeConjunction(rexBuilder, newBottomList, false); final Join newBottomJoin = bottomJoin.copy(bottomJoin.getTraitSet(), - newBottomCondition, relA, relC, bottomJoin.getJoinType(), bottomJoin.isSemiJoinDone()); + newBottomCondition, relA, relC, topJoin.getJoinType(), bottomJoin.isSemiJoinDone()); // target: | A | C | B | // source: | A | B | C | @@ -183,7 +190,7 @@ private void onMatchRight(RelOptRuleCall call) { RexNode newTopCondition = RexUtil.composeConjunction(rexBuilder, newTopList, false); @SuppressWarnings("SuspiciousNameCombination") final Join newTopJoin = topJoin.copy(topJoin.getTraitSet(), newTopCondition, - newBottomJoin, relB, topJoin.getJoinType(), topJoin.isSemiJoinDone()); + newBottomJoin, relB, bottomJoin.getJoinType(), topJoin.isSemiJoinDone()); assert !Mappings.isIdentity(thruProjectMapping); final RelBuilder relBuilder = call.builder(); diff --git a/druid/pom.xml b/druid/pom.xml index 7a75313efa99..67154c4adac7 100644 --- a/druid/pom.xml +++ b/druid/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-druid jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Druid Druid adapter for Calcite diff --git a/elasticsearch2/pom.xml b/elasticsearch2/pom.xml index 9c80c338f99c..ce57c4c272c1 100644 --- a/elasticsearch2/pom.xml +++ b/elasticsearch2/pom.xml @@ -21,12 +21,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-elasticsearch2 jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Elasticsearch Elasticsearch adapter for Calcite diff --git a/elasticsearch5/pom.xml b/elasticsearch5/pom.xml index b19a2e64fc27..0e7922b47a1d 100644 --- a/elasticsearch5/pom.xml +++ b/elasticsearch5/pom.xml @@ -21,12 +21,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-elasticsearch5 jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Elasticsearch5 Elasticsearch5 adapter for Calcite diff --git a/example/csv/pom.xml b/example/csv/pom.xml index 1105a6895b02..8d714ab5457b 100644 --- a/example/csv/pom.xml +++ b/example/csv/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite-example - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-example-csv jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Example CSV An example Calcite provider that reads CSV files diff --git a/example/function/pom.xml b/example/function/pom.xml index f3ff314b9f4c..d3e61d5177a2 100644 --- a/example/function/pom.xml +++ b/example/function/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite-example - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-example-function jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Example Function Examples of user-defined Calcite functions diff --git a/example/pom.xml b/example/pom.xml index 8053ef3e2900..133a622494f6 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -20,13 +20,13 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-example pom - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Examples Calcite examples diff --git a/file/pom.xml b/file/pom.xml index aad82cb2755e..b7fc06c4a43c 100644 --- a/file/pom.xml +++ b/file/pom.xml @@ -19,13 +19,13 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-file jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite File Calcite provider that reads files and URIs diff --git a/geode/pom.xml b/geode/pom.xml index c124984ddeee..2ff7901a36cf 100644 --- a/geode/pom.xml +++ b/geode/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-geode jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Geode Geode adapter for Calcite diff --git a/linq4j/pom.xml b/linq4j/pom.xml index 25a8cdb543e6..1ed0014755bd 100644 --- a/linq4j/pom.xml +++ b/linq4j/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-linq4j jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Linq4j Calcite APIs for LINQ (Language-Integrated Query) in Java diff --git a/mongodb/pom.xml b/mongodb/pom.xml index 5323d02fd5e6..ea12ec6d8299 100644 --- a/mongodb/pom.xml +++ b/mongodb/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-mongodb jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite MongoDB MongoDB adapter for Calcite diff --git a/pig/pom.xml b/pig/pom.xml index 54a315294051..8e02c72e8e82 100644 --- a/pig/pom.xml +++ b/pig/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-pig jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Pig Pig adapter for Calcite diff --git a/piglet/pom.xml b/piglet/pom.xml index e2b4631421f1..6b18b074052b 100644 --- a/piglet/pom.xml +++ b/piglet/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-piglet jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Piglet Pig-like language built on top of Calcite algebra diff --git a/plus/pom.xml b/plus/pom.xml index 13b8204c6821..1cdba8025a62 100644 --- a/plus/pom.xml +++ b/plus/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-plus jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Plus Miscellaneous extras for Calcite diff --git a/pom.xml b/pom.xml index dd8345ba1488..e58c4aba6a3d 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ limitations under the License. org.apache.calcite calcite pom - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite diff --git a/server/pom.xml b/server/pom.xml index 0d0ddefe1fc4..4bdb55200771 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-server jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Server Calcite Server diff --git a/spark/pom.xml b/spark/pom.xml index 9601c49bd878..b0ab939e9eb4 100644 --- a/spark/pom.xml +++ b/spark/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-spark jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Spark diff --git a/splunk/pom.xml b/splunk/pom.xml index a21c8458fba9..e6db61d8383e 100644 --- a/splunk/pom.xml +++ b/splunk/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 calcite-splunk jar - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7 Calcite Splunk Splunk adapter for Calcite; also a JDBC driver for Splunk diff --git a/ubenchmark/pom.xml b/ubenchmark/pom.xml index 6f8cea6c9df1..4b7bfe28c7f7 100644 --- a/ubenchmark/pom.xml +++ b/ubenchmark/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-4.x-r6 + 1.16.0-kylin-4.x-r7