Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 817764456 -> 257960b05
PHOENIX-3008 Prevent upgrade of existing multi-tenant table to map to namespace until we support it correctly Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/257960b0 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/257960b0 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/257960b0 Branch: refs/heads/4.x-HBase-1.1 Commit: 257960b056401602e48dd21089a14a637e11cd94 Parents: 8177644 Author: Ankit Singhal <ankitsingha...@gmail.com> Authored: Mon Jun 20 11:42:01 2016 -0700 Committer: Ankit Singhal <ankitsingha...@gmail.com> Committed: Mon Jun 20 11:42:01 2016 -0700 ---------------------------------------------------------------------- .../src/main/java/org/apache/phoenix/util/UpgradeUtil.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/257960b0/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java index 5b81a6c..3c07d95 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java @@ -1512,6 +1512,8 @@ public class UpgradeUtil { String schemaName = SchemaUtil.getSchemaNameFromFullName(tableName); // Confirm table is not already upgraded PTable table = PhoenixRuntime.getTable(conn, tableName); + if (table.isMultiTenant()) { throw new IllegalArgumentException( + "Sorry!! currently support for upgrading multi-tenant table to map to namespace is not supported!!"); } // Upgrade is not required if schemaName is not present. if (schemaName.equals("") && !PTableType.VIEW .equals(table.getType())) { throw new IllegalArgumentException("Table doesn't have schema name"); }