You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by sa...@apache.org on 2015/07/15 21:48:20 UTC

phoenix git commit: PHOENIX-2121 Fix flapping RowValueConstructorIT

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 53317b048 -> b95398bf4


PHOENIX-2121 Fix flapping RowValueConstructorIT


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

Branch: refs/heads/4.x-HBase-0.98
Commit: b95398bf4f7a39e35d4561f612ac2008d131f1ec
Parents: 53317b0
Author: Samarth <sa...@salesforce.com>
Authored: Wed Jul 15 12:48:01 2015 -0700
Committer: Samarth <sa...@salesforce.com>
Committed: Wed Jul 15 12:48:01 2015 -0700

----------------------------------------------------------------------
 .../phoenix/end2end/RowValueConstructorIT.java  | 46 +++++++++++---------
 1 file changed, 25 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b95398bf/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index e5cfeb0..5bf0a1e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -1430,21 +1430,22 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
     @Test
     public void testCountDistinct1() throws Exception {
         Connection conn = nextConnection(getUrl());
-        String ddl = "CREATE TABLE regions1 (region_name VARCHAR PRIMARY KEY, a INTEGER, b INTEGER)";
+        String tableName = "testCountDistinct1rvc";
+        String ddl = "CREATE TABLE " + tableName + " (region_name VARCHAR PRIMARY KEY, a INTEGER, b INTEGER)";
         conn.createStatement().execute(ddl);
         
         conn = nextConnection(getUrl());
-        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions1(region_name, a, b) VALUES('a', 6,3)");
+        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('a', 6,3)");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions1(region_name, a, b) VALUES('b', 2,4)");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('b', 2,4)");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions1(region_name, a, b) VALUES('c', 6,3)");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('c', 6,3)");
         stmt.execute();
         conn.commit();
 
         conn = nextConnection(getUrl());
         ResultSet rs;
-        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions1");
+        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from " + tableName);
         assertTrue(rs.next());
         assertEquals(2, rs.getInt(1));
         conn.close();
@@ -1453,22 +1454,23 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
     @Test
     public void testCountDistinct2() throws Exception {
         Connection conn = nextConnection(getUrl());
-        String ddl = "CREATE TABLE regions2 (region_name VARCHAR PRIMARY KEY, a VARCHAR, b VARCHAR)";
+        String tableName = "testCountDistinct2rvc";
+        String ddl = "CREATE TABLE  " + tableName + "  (region_name VARCHAR PRIMARY KEY, a VARCHAR, b VARCHAR)";
         conn.createStatement().execute(ddl);
         conn.commit();
         
         conn = nextConnection(getUrl());
-        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions2(region_name, a, b) VALUES('a', 'fooo','abc')");
+        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('a', 'fooo','abc')");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions2(region_name, a, b) VALUES('b', 'off','bac')");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('b', 'off','bac')");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions2(region_name, a, b) VALUES('c', 'fooo', 'abc')");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('c', 'fooo', 'abc')");
         stmt.execute();
         conn.commit();
 
         conn = nextConnection(getUrl());
         ResultSet rs;
-        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions2");
+        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from  " + tableName);
         assertTrue(rs.next());
         assertEquals(2, rs.getInt(1));
     }
@@ -1476,23 +1478,24 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
     @Test
     public void testCountDistinct3() throws Exception {
         Connection conn = nextConnection(getUrl());
-        String ddl = "CREATE TABLE regions3 (region_name VARCHAR PRIMARY KEY, a Boolean, b Boolean)";
+        String tableName = "testCountDistinct3rvc";
+        String ddl = "CREATE TABLE  " + tableName + "  (region_name VARCHAR PRIMARY KEY, a Boolean, b Boolean)";
         conn.createStatement().execute(ddl);
         
         conn = nextConnection(getUrl());
-        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions3(region_name, a, b) VALUES('a', true, true)");
+        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('a', true, true)");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions3(region_name, a, b) VALUES('b', true, False)");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('b', true, False)");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions3(region_name, a, b) VALUES('c', true, true)");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('c', true, true)");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions3(region_name, a, b) VALUES('d', true, false)");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('d', true, false)");
         stmt.execute();
         conn.commit();
 
         conn = nextConnection(getUrl());
         ResultSet rs;
-        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions3");
+        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from  " + tableName);
         assertTrue(rs.next());
         assertEquals(2, rs.getInt(1));
     }
@@ -1500,21 +1503,22 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
     @Test
     public void testCountDistinct4() throws Exception {
         Connection conn = nextConnection(getUrl());
-        String ddl = "CREATE TABLE regions4 (region_name VARCHAR PRIMARY KEY, a VARCHAR, b VARCHAR)";
+        String tableName = "testCountDistinct4rvc";
+        String ddl = "CREATE TABLE  " + tableName + "  (region_name VARCHAR PRIMARY KEY, a VARCHAR, b VARCHAR)";
         conn.createStatement().execute(ddl);
         
         conn = nextConnection(getUrl());
-        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions4(region_name, a, b) VALUES('a', 'fooo','abc')");
+        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('a', 'fooo','abc')");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions4(region_name, a, b) VALUES('b', 'off','bac')");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('b', 'off','bac')");
         stmt.execute();
-        stmt = conn.prepareStatement("UPSERT INTO regions4(region_name, a, b) VALUES('c', 'foo', 'abc')");
+        stmt = conn.prepareStatement("UPSERT INTO  " + tableName + " (region_name, a, b) VALUES('c', 'foo', 'abc')");
         stmt.execute();
         conn.commit();
         
         conn = nextConnection(getUrl());
         ResultSet rs;
-        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions4");
+        rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from  " + tableName);
         assertTrue(rs.next());
         assertEquals(3, rs.getInt(1));
     }