phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-0.98 42a21a950 -> 00a6a03c2 PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/00a6a03c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/00a6a03c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/00a6a03c Branch: refs/heads/4.x-HBase-0.98 Commit: 00a6a03c2d18f4f9e805c58636c923f77eca15bd Parents: 42a21a9 Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Wed Jan 24 09:57:07 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/00a6a03c/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELE
phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.2 77f7506c3 -> ace9b76f6 PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ace9b76f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ace9b76f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ace9b76f Branch: refs/heads/4.x-HBase-1.2 Commit: ace9b76f62fa4064e78493d61187350c01d0544c Parents: 77f7506 Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Wed Jan 24 09:58:59 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ace9b76f/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELECT
phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 aa9c7d6e4 -> 3cb0a1d89 PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3cb0a1d8 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3cb0a1d8 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3cb0a1d8 Branch: refs/heads/4.x-HBase-1.1 Commit: 3cb0a1d8995a126a2854f2c732764d10a5d65c42 Parents: aa9c7d6 Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Wed Jan 24 09:57:29 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cb0a1d8/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELECT
phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.11.2 4a3435ab3 -> 519cca954 PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/519cca95 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/519cca95 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/519cca95 Branch: refs/heads/4.x-cdh5.11.2 Commit: 519cca95435e1558d3edfd37e1462c44de80aa4d Parents: 4a3435a Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Wed Jan 24 09:59:35 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/519cca95/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELECT
phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
Repository: phoenix Updated Branches: refs/heads/master 65f91a11d -> 3a6c76f12 PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3a6c76f1 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3a6c76f1 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3a6c76f1 Branch: refs/heads/master Commit: 3a6c76f122d7df1aa6fe9eb76f100ea23d298a03 Parents: 65f91a1 Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Wed Jan 24 09:56:03 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3a6c76f1/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELECT NEXT VALUE FO
phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.3 a37a30a6c -> 37478531b PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/37478531 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/37478531 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/37478531 Branch: refs/heads/4.x-HBase-1.3 Commit: 37478531b9baa67557776054baeebde78843b69d Parents: a37a30a Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Thu Jan 25 12:16:42 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/37478531/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELECT
[3/3] phoenix git commit: PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name
PHOENIX-4548 UpgradeUtil.mapChildViewsToNamespace does not handle multi-tenant views that have the same name Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ab796a8f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ab796a8f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ab796a8f Branch: refs/heads/5.x-HBase-2.0 Commit: ab796a8f525c54d78b0c0414640544875feb2b62 Parents: 4031a9c Author: Thomas D'Silva Authored: Mon Jan 22 11:08:03 2018 -0800 Committer: Thomas D'Silva Committed: Wed Jan 24 10:04:38 2018 -0800 -- .../apache/phoenix/end2end/PhoenixDriverIT.java | 97 ++-- .../org/apache/phoenix/util/UpgradeUtil.java| 28 -- 2 files changed, 110 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ab796a8f/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java index 216653c..407e9cf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/PhoenixDriverIT.java @@ -17,10 +17,17 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM; +import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; @@ -31,14 +38,18 @@ import java.util.Properties; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.snapshot.SnapshotCreationException; +import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixDriver; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.LinkType; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.SchemaUtil; +import org.apache.phoenix.util.UpgradeUtil; import org.junit.BeforeClass; import org.junit.Test; @@ -60,16 +71,16 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { DriverManager.registerDriver(PhoenixDriver.INSTANCE); } -public Connection createConnection(boolean isMultiTenant, boolean isDifferentClient) throws SQLException { +public Connection createConnection(String tenantId, boolean isDifferentClient) throws SQLException { Properties props = new Properties(); props.setProperty(QueryServices.RETURN_SEQUENCE_VALUES_ATTRIB, "false"); // force the use of ConnectionQueryServicesImpl instead of ConnectionQueryServicesTestImpl props.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); -if (isMultiTenant) -props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1"); +if (tenantId!=null) +props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); StringBuilder sb = new StringBuilder(url); -if (isMultiTenant) +if (isDifferentClient) sb.append(PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + "Client2"); return DriverManager.getConnection(sb.toString(), props); } @@ -80,7 +91,7 @@ public class PhoenixDriverIT extends BaseUniqueNamesOwnClusterIT { String sequenceNameWithoutSchema = generateUniqueSequenceName(); String sequenceName = SchemaUtil.getTableName(schemaName, sequenceNameWithoutSchema); -Connection conn = createConnection(false, false); +Connection conn = createConnection(null, false); conn.createStatement().execute("CREATE SEQUENCE " + sequenceName + " START WITH 3 INCREMENT BY 2 CACHE 5"); String query = "SELECT NEXT VALUE FOR " + sequenceName ; @@ -94,7 +105,7 @@ public class PhoenixDriverIT extends