Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.2 e5ecf8c69 -> 3508086ce
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/3508086c Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/3508086c Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/3508086c Branch: refs/heads/4.x-HBase-1.2 Commit: 3508086ce69180caec66c01eb712a2e28f4d4135 Parents: e5ecf8c Author: Lars Hofhansl <la...@apache.org> Authored: Sat Nov 24 16:23:38 2018 -0800 Committer: Lars Hofhansl <la...@apache.org> Committed: Sat Nov 24 16:23:38 2018 -0800 ---------------------------------------------------------------------- .../phoenix/end2end/UpsertSelectAutoCommitIT.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/3508086c/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);