phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-2911 Don't use parent table schema name for auto partitioned tables
Date Wed, 18 May 2016 19:19:17 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 4837f1ff9 -> 3cf8f0b2b


PHOENIX-2911 Don't use parent table schema name for auto partitioned tables


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/3cf8f0b2
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3cf8f0b2
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3cf8f0b2

Branch: refs/heads/4.x-HBase-0.98
Commit: 3cf8f0b2b2798239ae380a0eb72843b89a075e32
Parents: 4837f1f
Author: James Taylor <jamestaylor@apache.org>
Authored: Wed May 18 12:21:50 2016 -0700
Committer: James Taylor <jamestaylor@apache.org>
Committed: Wed May 18 12:21:50 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java  | 6 +++---
 .../org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java   | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf8f0b2/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
index b21b772..3475986 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AutoPartitionViewsIT.java
@@ -64,7 +64,7 @@ public class AutoPartitionViewsIT extends BaseHBaseManagedTimeIT {
 
     public AutoPartitionViewsIT(boolean salted, boolean isMultiTenant) {
         this.isMultiTenant = isMultiTenant;
-        StringBuilder optionBuilder = new StringBuilder(" AUTO_PARTITION_SEQ=metric_id_seq");
+        StringBuilder optionBuilder = new StringBuilder(" AUTO_PARTITION_SEQ=METRIC_ID_SEQ");
         if (salted) optionBuilder.append(", SALTED=4 ");
         if (isMultiTenant) optionBuilder.append(", MULTI_TENANT=true ");
         this.tableDDLOptions = optionBuilder.toString();
@@ -232,7 +232,7 @@ public class AutoPartitionViewsIT extends BaseHBaseManagedTimeIT {
                             isMultiTenant ? "tenantId, ": "", 
                             tableDDLOptions);
             conn.createStatement().execute(ddl);
-            conn.createStatement().execute("CREATE SEQUENCE hbase.metric_id_seq CACHE 1");
+            conn.createStatement().execute("CREATE SEQUENCE metric_id_seq CACHE 1");
             // create a view
             viewConn1.createStatement().execute(
                 "CREATE VIEW metric1 AS SELECT * FROM hbase.metric_table WHERE val2=1.2");
@@ -306,7 +306,7 @@ public class AutoPartitionViewsIT extends BaseHBaseManagedTimeIT {
                             isMultiTenant ? "tenantId, ": "", 
                             tableDDLOptions);
             conn.createStatement().execute(ddl);
-            conn.createStatement().execute("CREATE SEQUENCE hbase.metric_id_seq CACHE 1");
+            conn.createStatement().execute("CREATE SEQUENCE metric_id_seq CACHE 1");
             // create a view
             viewConn1.createStatement().execute(
                 "CREATE VIEW metric1 AS SELECT * FROM hbase.metric_table");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/3cf8f0b2/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index 7eadb7e..180a4d1 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -1434,8 +1434,7 @@ public class MetaDataEndpointImpl extends MetaDataProtocol implements
Coprocesso
                     props.setProperty(PhoenixRuntime.NO_UPGRADE_ATTRIB, Boolean.TRUE.toString());
                     try (PhoenixConnection connection = DriverManager.getConnection(MetaDataUtil.getJdbcUrl(env),
props).unwrap(PhoenixConnection.class);
                             Statement stmt = connection.createStatement()) {
-                        String seqNextValueSql = String.format("SELECT NEXT VALUE FOR %s
FROM %s LIMIT 1",
-                            SchemaUtil.getTableName(parentTable.getSchemaName().getString(),
parentTable.getAutoPartitionSeqName()), PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME);
+                        String seqNextValueSql = String.format("SELECT NEXT VALUE FOR %s",
parentTable.getAutoPartitionSeqName());
                         ResultSet rs = stmt.executeQuery(seqNextValueSql);
                         rs.next();
                         autoPartitionNum = rs.getLong(1);


Mime
View raw message