You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by la...@apache.org on 2018/11/24 23:45:09 UTC

phoenix git commit: PHOENIX-5026; another test addendum.

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.4 0bad1a179 -> 2e4cd0ddb


PHOENIX-5026; another test addendum.


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

Branch: refs/heads/4.x-HBase-1.4
Commit: 2e4cd0ddb654819649075a80b6faab5d7cf5d9d3
Parents: 0bad1a1
Author: Lars Hofhansl <la...@apache.org>
Authored: Sat Nov 24 15:45:00 2018 -0800
Committer: Lars Hofhansl <la...@apache.org>
Committed: Sat Nov 24 15:45:00 2018 -0800

----------------------------------------------------------------------
 .../phoenix/end2end/UpsertSelectAutoCommitIT.java     | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2e4cd0dd/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
index 6fad376..4078578 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertSelectAutoCommitIT.java
@@ -175,16 +175,16 @@ public class UpsertSelectAutoCommitIT extends ParallelStatsDisabledIT {
         props.setProperty(QueryServices.ENABLE_SERVER_SIDE_MUTATIONS, allowServerSideMutations);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(true);
-        conn.createStatement().execute("CREATE SEQUENCE keys CACHE 1000");
         String tableName = generateUniqueName();
+        conn.createStatement().execute("CREATE SEQUENCE " + tableName + "_seq CACHE 1000");
         conn.createStatement().execute("CREATE TABLE " + tableName
                 + " (pk INTEGER PRIMARY KEY, val INTEGER) UPDATE_CACHE_FREQUENCY=3600000");
 
         conn.createStatement().execute(
-            "UPSERT INTO " + tableName + " VALUES (NEXT VALUE FOR keys,1)");
+            "UPSERT INTO " + tableName + " VALUES (NEXT VALUE FOR "+ tableName + "_seq,1)");
         PreparedStatement stmt =
                 conn.prepareStatement("UPSERT INTO " + tableName
-                        + " SELECT NEXT VALUE FOR keys, val FROM " + tableName);
+                        + " SELECT NEXT VALUE FOR "+ tableName + "_seq, val FROM " + tableName);
         HBaseAdmin admin =
                 driver.getConnectionQueryServices(getUrl(), TestUtil.TEST_PROPERTIES).getAdmin();
         for (int i=0; i<12; i++) {
@@ -192,8 +192,6 @@ public class UpsertSelectAutoCommitIT extends ParallelStatsDisabledIT {
             int upsertCount = stmt.executeUpdate();
             assertEquals((int)Math.pow(2, i), upsertCount);
         }
-        // cleanup after ourselves
-        conn.createStatement().execute("DROP SEQUENCE keys");
         admin.close();
         conn.close();
     }
@@ -234,17 +232,17 @@ public class UpsertSelectAutoCommitIT extends ParallelStatsDisabledIT {
         conn.setAutoCommit(false);
         String tableName = generateUniqueName();
 
-        conn.createStatement().execute("CREATE SEQUENCE "+ tableName);
+        conn.createStatement().execute("CREATE SEQUENCE "+ tableName + "_seq");
         conn.createStatement().execute(
                 "CREATE TABLE " + tableName + " (pk INTEGER PRIMARY KEY, val INTEGER)");
 
         conn.createStatement().execute(
-                "UPSERT INTO " + tableName + " VALUES (NEXT VALUE FOR keys,1)");
+                "UPSERT INTO " + tableName + " VALUES (NEXT VALUE FOR "+ tableName + "_seq, 1)");
         conn.commit();
         for (int i=0; i<6; i++) {
             Statement stmt = conn.createStatement();
             int upsertCount = stmt.executeUpdate(
-                    "UPSERT INTO " + tableName + " SELECT NEXT VALUE FOR keys, val FROM "
+                    "UPSERT INTO " + tableName + " SELECT NEXT VALUE FOR "+ tableName + "_seq, val FROM "
                             + tableName);
             conn.commit();
             assertEquals((int)Math.pow(2, i), upsertCount);