Apache-Phoenix | 5.1 | HBase 2.1 | Build #14 SUCCESS
5.1 branch HBase 2.1 build #14 status SUCCESS Build #14 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/14/
Apache-Phoenix | 4.x | HBase 1.6 | Build #247 SUCCESS
4.x branch HBase 1.6 build #247 status SUCCESS Build #247 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/247/
Apache-Phoenix | master | HBase 2.3 | Build #253 FAILURE
master branch HBase 2.3 build #253 status FAILURE Build #253 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/253/
Apache-Phoenix | 4.16 | HBase 1.6 | Build #37 FAILURE
4.16 branch HBase 1.6 build #37 status FAILURE Build #37 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/37/
Apache-Phoenix | 4.x | HBase 1.3 | Build #248 FAILURE
4.x branch HBase 1.3 build #248 status FAILURE Build #248 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/248/
Apache-Phoenix | 4.x | HBase 1.4 | Build #248 FAILURE
4.x branch HBase 1.4 build #248 status FAILURE Build #248 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/248/
Apache-Phoenix | 4.x | HBase 1.4 | Build #247 SUCCESS
4.x branch HBase 1.4 build #247 status SUCCESS Build #247 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/247/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #14 FAILURE
5.1 branch HBase 2.2 build #14 status FAILURE Build #14 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/14/
Apache-Phoenix | master | HBase 2.2 | Build #253 FAILURE
master branch HBase 2.2 build #253 status FAILURE Build #253 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/253/
Apache-Phoenix | master | HBase 2.4 | Build #253 FAILURE
master branch HBase 2.4 build #253 status FAILURE Build #253 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/253/
Apache-Phoenix | master | HBase 2.1 | Build #253 FAILURE
master branch HBase 2.1 build #253 status FAILURE Build #253 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/253/
Apache-Phoenix | 4.16 | HBase 1.3 | Build #37 ABORTED
4.16 branch HBase 1.3 build #37 status ABORTED Build #37 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/37/
Apache-Phoenix | 4.x | HBase 1.6 | Build #248 SUCCESS
4.x branch HBase 1.6 build #248 status SUCCESS Build #248 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/248/
Apache-Phoenix | 5.1 | HBase 2.4 | Build #14 FAILURE
5.1 branch HBase 2.4 build #14 status FAILURE Build #14 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/14/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #14 FAILURE
5.1 branch HBase 2.3 build #14 status FAILURE Build #14 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/14/
Apache-Phoenix | 4.16 | HBase 1.4 | Build #37 FAILURE
4.16 branch HBase 1.4 build #37 status FAILURE Build #37 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/37/
Apache-Phoenix | 4.x | HBase 1.3 | Build #247 FAILURE
4.x branch HBase 1.3 build #247 status FAILURE Build #247 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/247/
Apache-Phoenix | master | HBase 2.2 | Build #252 FAILURE
master branch HBase 2.2 build #252 status FAILURE Build #252 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/252/
[phoenix] branch 5.1 updated: PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new 512b199 PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) 512b199 is described below commit 512b199bf48f677c503715887e7397189e160ff1 Author: Viraj Jasani AuthorDate: Sun Mar 14 16:25:29 2021 +0530 PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) --- .../apache/phoenix/end2end/index/LocalIndexIT.java | 88 ++ .../phoenix/compile/ExplainPlanAttributes.java | 2 +- 2 files changed, 59 insertions(+), 31 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java index 3b1c554..279c2e7 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java @@ -55,11 +55,14 @@ import org.apache.hadoop.hbase.client.TableDescriptorBuilder; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.CommonFSUtils; import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.compile.ExplainPlan; +import org.apache.phoenix.compile.ExplainPlanAttributes; import org.apache.phoenix.compile.QueryPlan; import org.apache.phoenix.coprocessor.BaseScannerRegionObserver; import org.apache.phoenix.end2end.ExplainPlanWithStatsEnabledIT.Estimate; import org.apache.phoenix.hbase.index.IndexRegionSplitPolicy; import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.jdbc.PhoenixPreparedStatement; import org.apache.phoenix.jdbc.PhoenixResultSet; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; @@ -278,42 +281,67 @@ public class LocalIndexIT extends BaseLocalIndexIT { conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(pk1,pk2,v1,v2)"); // 1. same prefix length, no other restrictions, but v3 is in the SELECT. Use the main table. -ResultSet rs = conn.createStatement().executeQuery("EXPLAIN SELECT * FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ physicalTableName + " [3,4]", -QueryUtil.getExplainPlan(rs)); -rs.close(); +ExplainPlan explainPlan = conn.prepareStatement("SELECT * FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4") +.unwrap(PhoenixPreparedStatement.class).optimizeQuery() +.getExplainPlan(); +ExplainPlanAttributes explainPlanAttributes = +explainPlan.getPlanStepsAsAttributes(); +assertEquals("PARALLEL 1-WAY", +explainPlanAttributes.getIteratorTypeAndScanSize()); +assertEquals("RANGE SCAN ", +explainPlanAttributes.getExplainScanType()); +assertEquals(physicalTableName.toString(), explainPlanAttributes.getTableName()); +assertEquals(" [3,4]", explainPlanAttributes.getKeyRanges()); // 2. same prefix length, no other restrictions. Only index columns used. Use the index. -rs = conn.createStatement().executeQuery("EXPLAIN SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ indexPhysicalTableName + " [1,3,4]\n" -+ "SERVER FILTER BY FIRST KEY ONLY\n" -+ "CLIENT MERGE SORT", -QueryUtil.getExplainPlan(rs)); -rs.close(); +explainPlan = conn.prepareStatement("SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4") +.unwrap(PhoenixPreparedStatement.class).optimizeQuery() +.getExplainPlan(); +explainPlanAttributes = +explainPlan.getPlanStepsAsAttributes(); +assertEquals("PARALLEL 1-WAY", +explainPlanAttributes.getIteratorTypeAndScanSize()); +assertEquals("RANGE SCAN ", +explainPlanAttributes.getExplainScanType()); +assertEquals(indexPhysicalTableName, explainPlanAttributes.getTableName()); +assertEquals(" [1,3,4]", explainPlanAttributes.getKeyRanges()); +assertEquals("SERVER FILTER BY FIRST KEY ONLY", +explainPlanAttributes.getServerWhereFilter()); +assertEquals("CLIENT MERGE SORT", +explainPlanAttributes.getClientSortAlgo()); // 3. same prefix length, but there's a column not on the index -rs = conn.createStatement().executeQuery("EXPLAIN SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2
[phoenix] branch master updated (e0c500d -> ebe46e1)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git. from e0c500d PHOENIX-6409 Include local index uncovered columns merge in explain plan. add ebe46e1 PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) No new revisions were added by this update. Summary of changes: .../apache/phoenix/end2end/index/LocalIndexIT.java | 88 ++ .../phoenix/compile/ExplainPlanAttributes.java | 2 +- 2 files changed, 59 insertions(+), 31 deletions(-)
[phoenix] branch 4.x updated: PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/4.x by this push: new e6d7d0b PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) e6d7d0b is described below commit e6d7d0b463707cae835a68d55c81cdbddcaa4db0 Author: Viraj Jasani AuthorDate: Sun Mar 14 16:25:29 2021 +0530 PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) --- .../apache/phoenix/end2end/index/LocalIndexIT.java | 88 ++ .../phoenix/compile/ExplainPlanAttributes.java | 2 +- 2 files changed, 59 insertions(+), 31 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java index 9bff734..9f79107 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java @@ -54,11 +54,14 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.compile.ExplainPlan; +import org.apache.phoenix.compile.ExplainPlanAttributes; import org.apache.phoenix.compile.QueryPlan; import org.apache.phoenix.coprocessor.BaseScannerRegionObserver; import org.apache.phoenix.end2end.ExplainPlanWithStatsEnabledIT.Estimate; import org.apache.phoenix.hbase.index.IndexRegionSplitPolicy; import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.jdbc.PhoenixPreparedStatement; import org.apache.phoenix.jdbc.PhoenixResultSet; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; @@ -277,42 +280,67 @@ public class LocalIndexIT extends BaseLocalIndexIT { conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(pk1,pk2,v1,v2)"); // 1. same prefix length, no other restrictions, but v3 is in the SELECT. Use the main table. -ResultSet rs = conn.createStatement().executeQuery("EXPLAIN SELECT * FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ physicalTableName + " [3,4]", -QueryUtil.getExplainPlan(rs)); -rs.close(); +ExplainPlan explainPlan = conn.prepareStatement("SELECT * FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4") +.unwrap(PhoenixPreparedStatement.class).optimizeQuery() +.getExplainPlan(); +ExplainPlanAttributes explainPlanAttributes = +explainPlan.getPlanStepsAsAttributes(); +assertEquals("PARALLEL 1-WAY", +explainPlanAttributes.getIteratorTypeAndScanSize()); +assertEquals("RANGE SCAN ", +explainPlanAttributes.getExplainScanType()); +assertEquals(physicalTableName.toString(), explainPlanAttributes.getTableName()); +assertEquals(" [3,4]", explainPlanAttributes.getKeyRanges()); // 2. same prefix length, no other restrictions. Only index columns used. Use the index. -rs = conn.createStatement().executeQuery("EXPLAIN SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ indexPhysicalTableName + " [1,3,4]\n" -+ "SERVER FILTER BY FIRST KEY ONLY\n" -+ "CLIENT MERGE SORT", -QueryUtil.getExplainPlan(rs)); -rs.close(); +explainPlan = conn.prepareStatement("SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4") +.unwrap(PhoenixPreparedStatement.class).optimizeQuery() +.getExplainPlan(); +explainPlanAttributes = +explainPlan.getPlanStepsAsAttributes(); +assertEquals("PARALLEL 1-WAY", +explainPlanAttributes.getIteratorTypeAndScanSize()); +assertEquals("RANGE SCAN ", +explainPlanAttributes.getExplainScanType()); +assertEquals(indexPhysicalTableName, explainPlanAttributes.getTableName()); +assertEquals(" [1,3,4]", explainPlanAttributes.getKeyRanges()); +assertEquals("SERVER FILTER BY FIRST KEY ONLY", +explainPlanAttributes.getServerWhereFilter()); +assertEquals("CLIENT MERGE SORT", +explainPlanAttributes.getClientSortAlgo()); // 3. same prefix length, but there's a column not on the index -rs = conn.createStatement().executeQuery("EXPLAIN SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4 AND v3 = 1"); -
[phoenix] branch 4.16 updated (010ca2b -> 2c88e28)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a change to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git. from 010ca2b PHOENIX-6385 : For non-small Scan, not to use Scan#setSmall for HBase 2.x versions (#1167) new b69c201 PHOENIX-6409 Include local index uncovered columns merge in explain plan. new 2c88e28 PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) 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. Summary of changes: .../phoenix/end2end/CostBasedDecisionIT.java | 4 + .../apache/phoenix/end2end/index/LocalIndexIT.java | 99 +++--- .../phoenix/end2end/index/MutableIndexIT.java | 1 + .../apache/phoenix/end2end/index/ViewIndexIT.java | 1 + .../phoenix/end2end/join/HashJoinLocalIndexIT.java | 3 + .../phoenix/compile/ExplainPlanAttributes.java | 23 - .../org/apache/phoenix/iterate/ExplainTable.java | 9 ++ 7 files changed, 109 insertions(+), 31 deletions(-)
[phoenix] 01/02: PHOENIX-6409 Include local index uncovered columns merge in explain plan.
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git commit b69c2014c5501fc16988c79c1e8df7f97b6a721a Author: Lars AuthorDate: Thu Mar 11 13:25:35 2021 -0800 PHOENIX-6409 Include local index uncovered columns merge in explain plan. --- .../phoenix/end2end/CostBasedDecisionIT.java | 4 .../apache/phoenix/end2end/index/LocalIndexIT.java | 13 .../phoenix/end2end/index/MutableIndexIT.java | 1 + .../apache/phoenix/end2end/index/ViewIndexIT.java | 1 + .../phoenix/end2end/join/HashJoinLocalIndexIT.java | 3 +++ .../phoenix/compile/ExplainPlanAttributes.java | 23 -- .../org/apache/phoenix/iterate/ExplainTable.java | 9 + 7 files changed, 52 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java index e2f5cfb..15414a8 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CostBasedDecisionIT.java @@ -361,10 +361,12 @@ public class CostBasedDecisionIT extends BaseUniqueNamesOwnClusterIT { verifyQueryPlan(query, "UNION ALL OVER 2 QUERIES\n" + "CLIENT PARALLEL 1-WAY RANGE SCAN OVER " + tableName + " [1]\n" + +"SERVER MERGE [0.C2]\n" + "SERVER FILTER BY FIRST KEY ONLY AND \"ROWKEY\" <= 'z'\n" + "SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [\"C1\"]\n" + "CLIENT MERGE SORT\n" + "CLIENT PARALLEL 1-WAY RANGE SCAN OVER " + tableName + " [1]\n" + +"SERVER MERGE [0.C2]\n" + "SERVER FILTER BY FIRST KEY ONLY AND \"ROWKEY\" >= 'a'\n" + "SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [\"C1\"]\n" + "CLIENT MERGE SORT"); @@ -413,11 +415,13 @@ public class CostBasedDecisionIT extends BaseUniqueNamesOwnClusterIT { // Use the optimal plan based on cost when stats become available. verifyQueryPlan(query, "CLIENT PARALLEL 626-WAY RANGE SCAN OVER " + tableName + " [1,'X0'] - [1,'X1']\n" + +"SERVER MERGE [0.C2]\n" + "SERVER FILTER BY FIRST KEY ONLY\n" + "SERVER SORTED BY [\"T1.:ROWKEY\"]\n" + "CLIENT MERGE SORT\n" + "PARALLEL INNER-JOIN TABLE 0\n" + "CLIENT PARALLEL 1-WAY RANGE SCAN OVER " + tableName + " [1]\n" + +"SERVER MERGE [0.C2]\n" + "SERVER FILTER BY FIRST KEY ONLY AND \"ROWKEY\" <= 'z'\n" + "SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [\"C1\"]\n" + "CLIENT MERGE SORT\n" + diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java index 2de2c94..9bff734 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java @@ -308,6 +308,7 @@ public class LocalIndexIT extends BaseLocalIndexIT { assertEquals( "CLIENT PARALLEL 1-WAY RANGE SCAN OVER " + physicalTableName + " [1,3,4,3]\n" ++ "SERVER MERGE [0.V3]\n" + "SERVER FILTER BY FIRST KEY ONLY AND \"V3\" = 1\n" + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs)); @@ -337,6 +338,7 @@ public class LocalIndexIT extends BaseLocalIndexIT { assertEquals( "CLIENT PARALLEL 16-WAY RANGE SCAN OVER " + indexPhysicalTableName + " [1,2,3]\n" ++ "SERVER MERGE [0.V1]\n" + "SERVER FILTER BY FIRST KEY ONLY\n" + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs)); @@ -382,6 +384,7 @@ public class LocalIndexIT extends BaseLocalIndexIT { assertEquals( "CLIENT PARALLEL 1-WAY RANGE SCAN OVER " + indexPhysicalTableName + " [1]\n" ++ "SERVER MERGE [0.V1]\n" + "SERVER FILTER BY FIRST KEY ONLY\n" + "CLIENT MERGE SORT", QueryUtil.getExplainPlan(rs)); @@ -402,6 +405,7 @@ public class LocalIndexIT extends BaseLocalIndexIT { assertEquals( "CLIENT PARALLEL 1-WAY RANGE SCAN OVER "
[phoenix] 02/02: PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git commit 2c88e28a8162c568ef79b653059a04fc6b37ac76 Author: Viraj Jasani AuthorDate: Sun Mar 14 16:25:29 2021 +0530 PHOENIX-6409 : Test with new Explain API for local index uncovered columns merge (ADDENDUM) --- .../apache/phoenix/end2end/index/LocalIndexIT.java | 88 ++ .../phoenix/compile/ExplainPlanAttributes.java | 2 +- 2 files changed, 59 insertions(+), 31 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java index 9bff734..9f79107 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java @@ -54,11 +54,14 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.util.Pair; +import org.apache.phoenix.compile.ExplainPlan; +import org.apache.phoenix.compile.ExplainPlanAttributes; import org.apache.phoenix.compile.QueryPlan; import org.apache.phoenix.coprocessor.BaseScannerRegionObserver; import org.apache.phoenix.end2end.ExplainPlanWithStatsEnabledIT.Estimate; import org.apache.phoenix.hbase.index.IndexRegionSplitPolicy; import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.jdbc.PhoenixPreparedStatement; import org.apache.phoenix.jdbc.PhoenixResultSet; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; @@ -277,42 +280,67 @@ public class LocalIndexIT extends BaseLocalIndexIT { conn.createStatement().execute("CREATE LOCAL INDEX " + indexName + " ON " + tableName + "(pk1,pk2,v1,v2)"); // 1. same prefix length, no other restrictions, but v3 is in the SELECT. Use the main table. -ResultSet rs = conn.createStatement().executeQuery("EXPLAIN SELECT * FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ physicalTableName + " [3,4]", -QueryUtil.getExplainPlan(rs)); -rs.close(); +ExplainPlan explainPlan = conn.prepareStatement("SELECT * FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4") +.unwrap(PhoenixPreparedStatement.class).optimizeQuery() +.getExplainPlan(); +ExplainPlanAttributes explainPlanAttributes = +explainPlan.getPlanStepsAsAttributes(); +assertEquals("PARALLEL 1-WAY", +explainPlanAttributes.getIteratorTypeAndScanSize()); +assertEquals("RANGE SCAN ", +explainPlanAttributes.getExplainScanType()); +assertEquals(physicalTableName.toString(), explainPlanAttributes.getTableName()); +assertEquals(" [3,4]", explainPlanAttributes.getKeyRanges()); // 2. same prefix length, no other restrictions. Only index columns used. Use the index. -rs = conn.createStatement().executeQuery("EXPLAIN SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ indexPhysicalTableName + " [1,3,4]\n" -+ "SERVER FILTER BY FIRST KEY ONLY\n" -+ "CLIENT MERGE SORT", -QueryUtil.getExplainPlan(rs)); -rs.close(); +explainPlan = conn.prepareStatement("SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4") +.unwrap(PhoenixPreparedStatement.class).optimizeQuery() +.getExplainPlan(); +explainPlanAttributes = +explainPlan.getPlanStepsAsAttributes(); +assertEquals("PARALLEL 1-WAY", +explainPlanAttributes.getIteratorTypeAndScanSize()); +assertEquals("RANGE SCAN ", +explainPlanAttributes.getExplainScanType()); +assertEquals(indexPhysicalTableName, explainPlanAttributes.getTableName()); +assertEquals(" [1,3,4]", explainPlanAttributes.getKeyRanges()); +assertEquals("SERVER FILTER BY FIRST KEY ONLY", +explainPlanAttributes.getServerWhereFilter()); +assertEquals("CLIENT MERGE SORT", +explainPlanAttributes.getClientSortAlgo()); // 3. same prefix length, but there's a column not on the index -rs = conn.createStatement().executeQuery("EXPLAIN SELECT v2 FROM " + tableName + " WHERE pk1 = 3 AND pk2 = 4 AND v3 = 1"); -assertEquals( -"CLIENT PARALLEL 1-WAY RANGE SCAN OVER " -+ physicalTableName + " [3,4]\n" -+ "SERVER FILTER BY V3 = 1", -
Apache-Phoenix | 5.1 | HBase 2.4 | Build #13 SUCCESS
5.1 branch HBase 2.4 build #13 status SUCCESS Build #13 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/13/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #13 FAILURE
5.1 branch HBase 2.3 build #13 status FAILURE Build #13 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/13/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #13 FAILURE
5.1 branch HBase 2.2 build #13 status FAILURE Build #13 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/13/
Apache-Phoenix | master | HBase 2.3 | Build #252 FAILURE
master branch HBase 2.3 build #252 status FAILURE Build #252 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/252/
Apache-Phoenix | 5.1 | HBase 2.1 | Build #13 SUCCESS
5.1 branch HBase 2.1 build #13 status SUCCESS Build #13 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/13/
Apache-Phoenix | master | HBase 2.1 | Build #252 SUCCESS
master branch HBase 2.1 build #252 status SUCCESS Build #252 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/252/
Apache-Phoenix | master | HBase 2.4 | Build #252 FAILURE
master branch HBase 2.4 build #252 status FAILURE Build #252 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/252/