Repository: phoenix Updated Branches: refs/heads/calcite 2bfebfd1d -> d46eed5e0
Update code and test ref based on latest Calcite master Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/d46eed5e Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d46eed5e Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d46eed5e Branch: refs/heads/calcite Commit: d46eed5e0830352d025fa29261b99aedb7fb8a20 Parents: 2bfebfd Author: maryannxue <wei....@intel.com> Authored: Wed Oct 28 10:24:47 2015 -0400 Committer: maryannxue <wei....@intel.com> Committed: Wed Oct 28 10:24:47 2015 -0400 ---------------------------------------------------------------------- .../org/apache/phoenix/calcite/CalciteIT.java | 27 ++++++++++---------- .../calcite/jdbc/PhoenixPrepareImpl.java | 4 +++ 2 files changed, 18 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/d46eed5e/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIT.java b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIT.java index 3f001e0..385ebaf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIT.java @@ -999,12 +999,12 @@ public class CalciteIT extends BaseClientManagedTimeIT { " PhoenixToClientConverter\n" + " PhoenixServerJoin(condition=[=($0, $7)], joinType=[left], isSingleValueRhs=[true])\n" + " PhoenixTableScan(table=[[phoenix, Join, ItemTable]])\n" + - " PhoenixServerAggregate(group=[{7}], SQ=[MAX($4)], isOrdered=[false])\n" + - " PhoenixServerJoin(condition=[=($2, $7)], joinType=[inner])\n" + - " PhoenixTableScan(table=[[phoenix, Join, OrderTable]])\n" + + " PhoenixServerAggregate(group=[{0}], SQ=[MAX($5)], isOrdered=[true])\n" + + " PhoenixServerJoin(condition=[=($3, $0)], joinType=[inner])\n" + + " PhoenixServerProject(item_id=[$0])\n" + + " PhoenixTableScan(table=[[phoenix, Join, ItemTable]])\n" + " PhoenixToClientConverter\n" + - " PhoenixServerProject(item_id=[$0])\n" + - " PhoenixTableScan(table=[[phoenix, Join, ItemTable]])\n") + " PhoenixTableScan(table=[[phoenix, Join, OrderTable]])\n") .resultIs(new Object[][] { new Object[] {"0000000001", "T1", 1000}, new Object[] {"0000000002", "T2", 3000}, @@ -1027,8 +1027,9 @@ public class CalciteIT extends BaseClientManagedTimeIT { " PhoenixToClientConverter\n" + " PhoenixServerJoin(condition=[=($2, $7)], joinType=[inner])\n" + " PhoenixTableScan(table=[[phoenix, Join, OrderTable]])\n" + - " PhoenixServerAggregate(group=[{0}], isOrdered=[true])\n" + - " PhoenixTableScan(table=[[phoenix, Join, ItemTable]], filter=[<($0, '0000000006')])\n") + " PhoenixToClientConverter\n" + + " PhoenixServerProject(item_id=[$0])\n" + + " PhoenixTableScan(table=[[phoenix, Join, ItemTable]], filter=[<($0, '0000000006')])\n") .resultIs(new Object[][] { new Object[] {"0000000001", "T1", 1000}, new Object[] {"0000000002", "T2", 3000}, @@ -1287,15 +1288,15 @@ public class CalciteIT extends BaseClientManagedTimeIT { "PhoenixToEnumerableConverter\n" + " PhoenixClientProject(item_id=[$0], NAME=[$1])\n" + " PhoenixToClientConverter\n" + - " PhoenixServerSemiJoin(condition=[=($0, $8)], joinType=[inner])\n" + + " PhoenixServerSemiJoin(condition=[=($0, $7)], joinType=[inner])\n" + " PhoenixTableScan(table=[[phoenix, Join, ItemTable]])\n" + - " PhoenixClientProject($f0=[true], item_id0=[$7])\n" + + " PhoenixClientProject(item_id0=[$0], $f0=[true])\n" + " PhoenixToClientConverter\n" + - " PhoenixServerJoin(condition=[=($7, $2)], joinType=[inner])\n" + - " PhoenixTableScan(table=[[phoenix, Join, OrderTable]])\n" + + " PhoenixServerJoin(condition=[=($0, $3)], joinType=[inner])\n" + + " PhoenixServerProject(item_id=[$0])\n" + + " PhoenixTableScan(table=[[phoenix, Join, ItemTable]])\n" + " PhoenixToClientConverter\n" + - " PhoenixServerProject(item_id=[$0])\n" + - " PhoenixTableScan(table=[[phoenix, Join, ItemTable]])\n"; + " PhoenixTableScan(table=[[phoenix, Join, OrderTable]])\n"; start(correlProps).sql(q3a).explainIs(p3aCorrelate).resultIs(r3a).close(); start(decorrelProps).sql(q3a).explainIs(p3aDecorrelated).resultIs(r3a).close(); // Test PhoenixClientSemiJoin http://git-wip-us.apache.org/repos/asf/phoenix/blob/d46eed5e/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java index b165c40..3d50429 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java @@ -13,6 +13,8 @@ import org.apache.calcite.prepare.CalcitePrepareImpl; import org.apache.calcite.prepare.Prepare.Materialization; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.rules.JoinCommuteRule; +import org.apache.calcite.rel.rules.SortJoinTransposeRule; +import org.apache.calcite.rel.rules.SortUnionTransposeRule; import org.apache.calcite.runtime.Hook; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParser; @@ -65,6 +67,8 @@ public class PhoenixPrepareImpl extends CalcitePrepareImpl { planner.removeRule(EnumerableRules.ENUMERABLE_SEMI_JOIN_RULE); planner.removeRule(JoinCommuteRule.INSTANCE); planner.addRule(JoinCommuteRule.SWAP_OUTER); + planner.removeRule(SortUnionTransposeRule.INSTANCE); + planner.addRule(SortUnionTransposeRule.MATCH_NULL_FETCH); for (RelOptRule rule : this.defaultConverterRules) { planner.addRule(rule);