You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by pb...@apache.org on 2018/11/27 15:18:38 UTC
[28/28] phoenix git commit: PHOENIX-5026; another test addendum.
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/50555125
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/50555125
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/50555125
Branch: refs/heads/4.x-cdh5.15
Commit: 5055512515c7c5cf3dc359a50c0b5bb07398f4aa
Parents: 027d21e
Author: Lars Hofhansl <la...@apache.org>
Authored: Sun Nov 25 00:23:38 2018 +0000
Committer: Pedro Boado <pb...@apache.org>
Committed: Tue Nov 27 15:12:24 2018 +0000
----------------------------------------------------------------------
.../phoenix/end2end/UpsertSelectAutoCommitIT.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/50555125/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);