phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject [3/6] phoenix git commit: PHOENIX-2822 Tests that extend BaseHBaseManagedTimeIT are very slow(Rahul Gidwani)
Date Fri, 08 Apr 2016 21:57:18 GMT
http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
index 8f2bc73..c4e4665 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryMoreIT.java
@@ -44,7 +44,7 @@ import org.junit.Test;
 import com.google.common.collect.Lists;
 
 
-public class QueryMoreIT extends BaseHBaseManagedTimeIT {
+public class QueryMoreIT extends BaseHBaseManagedTimeTableReuseIT {
     
     private String dataTableName;
     //queryAgainstTenantSpecificView = true, dataTableSalted = true 
@@ -74,8 +74,9 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
     private void testQueryMore(boolean queryAgainstTenantSpecificView, boolean dataTableSalted) throws Exception {
         String[] tenantIds = new String[] {"00Dxxxxxtenant1", "00Dxxxxxtenant2", "00Dxxxxxtenant3"};
         int numRowsPerTenant = 10;
-        String cursorTableName = "CURSOR_TABLE";
-        this.dataTableName = "BASE_HISTORY_TABLE" + (dataTableSalted ? "_SALTED" : "");
+        String cursorTableName = generateRandomString();
+        String base_history_table = generateRandomString();
+        this.dataTableName = base_history_table + (dataTableSalted ? "_SALTED" : "");
         String cursorTableDDL = "CREATE TABLE IF NOT EXISTS " + 
                 cursorTableName +  " (\n" +  
                 "TENANT_ID VARCHAR(15) NOT NULL\n," +  
@@ -109,7 +110,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         String cursorQueryId = "00TcursrqueryId";
         String tableOrViewName = queryAgainstTenantSpecificView ? ("HISTORY_TABLE_" + tenantId) : dataTableName;
         
-        assertEquals(numRowsPerTenant, upsertSelectRecordsInCursorTableForTenant(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId));
+        assertEquals(numRowsPerTenant, upsertSelectRecordsInCursorTableForTenant(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId,
+            cursorTableName));
         
         /*// assert that the data inserted in cursor table matches the data in the data table for tenantId.
         String selectDataTable = "SELECT TENANT_ID, PARENT_ID, CREATED_DATE, ENTITY_HISTORY_ID FROM BASE_HISTORY_TABLE WHERE TENANT_ID = ? ";
@@ -142,7 +144,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         int numRecordsThatShouldBeRetrieved = numRowsPerTenant/2; // we will test for two rounds of query more.
         
         // get first batch of cursor ids out of the cursor table.
-        String[] cursorIds = getRecordsOutofCursorTable(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId, startOrder, endOrder);
+        String[] cursorIds = getRecordsOutofCursorTable(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId, startOrder, endOrder,
+            cursorTableName);
         assertEquals(numRecordsThatShouldBeRetrieved, cursorIds.length);
         // now query and fetch first batch of records.
         List<String> historyIds = doQueryMore(queryAgainstTenantSpecificView, tenantId, tableOrViewName, cursorIds);
@@ -150,7 +153,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         assertEquals(historyIdsPerTenant.get(tenantId).subList(startOrder, endOrder), historyIds);
         
         // get the next batch of cursor ids out of the cursor table.
-        cursorIds = getRecordsOutofCursorTable(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId, startOrder + numRecordsThatShouldBeRetrieved, endOrder + numRecordsThatShouldBeRetrieved);
+        cursorIds = getRecordsOutofCursorTable(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId, startOrder + numRecordsThatShouldBeRetrieved, endOrder + numRecordsThatShouldBeRetrieved,
+            cursorTableName);
         assertEquals(numRecordsThatShouldBeRetrieved, cursorIds.length);
         // now query and fetch the next batch of records.
         historyIds = doQueryMore(queryAgainstTenantSpecificView, tenantId, tableOrViewName, cursorIds);
@@ -158,7 +162,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         assertEquals(historyIdsPerTenant.get(tenantId).subList(startOrder + numRecordsThatShouldBeRetrieved, endOrder+ numRecordsThatShouldBeRetrieved), historyIds);
         
          // get the next batch of cursor ids out of the cursor table.
-        cursorIds = getRecordsOutofCursorTable(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId, startOrder + 2 * numRecordsThatShouldBeRetrieved, endOrder + 2 * numRecordsThatShouldBeRetrieved);
+        cursorIds = getRecordsOutofCursorTable(tableOrViewName, queryAgainstTenantSpecificView, tenantId, cursorQueryId, startOrder + 2 * numRecordsThatShouldBeRetrieved, endOrder + 2 * numRecordsThatShouldBeRetrieved,
+            cursorTableName);
         // assert that there are no more cursorids left for this tenant.
         assertEquals(0, cursorIds.length);
     }
@@ -193,7 +198,8 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         }
     }
     
-    private int upsertSelectRecordsInCursorTableForTenant(String tableOrViewName, boolean queryAgainstTenantView, String tenantId, String cursorQueryId) throws Exception {
+    private int upsertSelectRecordsInCursorTableForTenant(String tableOrViewName, boolean queryAgainstTenantView, String tenantId, String cursorQueryId,
+        final String cursorTable) throws Exception {
         String sequenceName = "\"" + tenantId + "_SEQ\"";
         Connection conn = queryAgainstTenantView ? getTenantSpecificConnection(tenantId) : DriverManager.getConnection(getUrl());
         
@@ -207,7 +213,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
             String tenantIdFilter = queryAgainstTenantView ? "" : " WHERE TENANT_ID = ? ";
             
             // Using dynamic columns, we can use the same cursor table for storing primary keys for all the tables.  
-            String upsertSelectDML = "UPSERT INTO CURSOR_TABLE " +
+            String upsertSelectDML = "UPSERT INTO " + cursorTable + " " +
                                      "(TENANT_ID, QUERY_ID, CURSOR_ORDER, PARENT_ID CHAR(15), CREATED_DATE DATE, ENTITY_HISTORY_ID CHAR(15)) " + 
                                      "SELECT ?, ?, NEXT VALUE FOR " + sequenceName + ", PARENT_ID, CREATED_DATE, ENTITY_HISTORY_ID " +
                                      " FROM " + tableOrViewName + tenantIdFilter;
@@ -240,13 +246,14 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
         return tenantViewName;
     }
     
-    private String[] getRecordsOutofCursorTable(String tableOrViewName, boolean queryAgainstTenantSpecificView, String tenantId, String cursorQueryId, int startOrder, int endOrder) throws Exception {
+    private String[] getRecordsOutofCursorTable(String tableOrViewName, boolean queryAgainstTenantSpecificView, String tenantId, String cursorQueryId,
+        int startOrder, int endOrder, final String cursorTable) throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         List<String> pkIds = new ArrayList<String>();
         String cols = queryAgainstTenantSpecificView ? "PARENT_ID, CREATED_DATE, ENTITY_HISTORY_ID" : "TENANT_ID, PARENT_ID, CREATED_DATE, ENTITY_HISTORY_ID";
         String dynCols = queryAgainstTenantSpecificView ? "(PARENT_ID CHAR(15), CREATED_DATE DATE, ENTITY_HISTORY_ID CHAR(15))" : "(TENANT_ID CHAR(15), PARENT_ID CHAR(15), CREATED_DATE DATE, ENTITY_HISTORY_ID CHAR(15))";
         String selectCursorSql = "SELECT " + cols + " " +
-                "FROM CURSOR_TABLE \n" +
+            "FROM " + cursorTable + " \n" +
                  dynCols +   " \n" + 
                 "WHERE TENANT_ID = ? AND \n" +  
                 "QUERY_ID = ? AND \n" + 
@@ -335,7 +342,7 @@ public class QueryMoreIT extends BaseHBaseManagedTimeIT {
     @SuppressWarnings("deprecation")
     @Test
     public void testNullBigDecimalWithScale() throws Exception {
-        final String table = "NULLBIGDECIMAL";
+        final String table = generateRandomString();
         final Connection conn = DriverManager.getConnection(getUrl());
         conn.setAutoCommit(true);
         try (Statement stmt = conn.createStatement()) {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/RTrimFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RTrimFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RTrimFunctionIT.java
index 2caca2b..f691dd0 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RTrimFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RTrimFunctionIT.java
@@ -33,7 +33,7 @@ import org.apache.phoenix.util.QueryUtil;
 import org.junit.Test;
 
 
-public class RTrimFunctionIT extends BaseHBaseManagedTimeIT {
+public class RTrimFunctionIT extends BaseHBaseManagedTimeTableReuseIT {
     
     @Test
     public void testWithFixedLengthAscPK() throws Exception {
@@ -48,23 +48,25 @@ public class RTrimFunctionIT extends BaseHBaseManagedTimeIT {
     private void testWithFixedLengthPK(SortOrder sortOrder, List<Object> expectedResults) throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
-        conn.createStatement().execute("CREATE TABLE rtrim_test ( k VARCHAR PRIMARY KEY " + (sortOrder == SortOrder.DESC ? "DESC" : "") + ")");
+        String tableName = generateRandomString();
+        conn.createStatement().execute(
+            "CREATE TABLE " + tableName + " ( k VARCHAR PRIMARY KEY " + (sortOrder == SortOrder.DESC ? "DESC" : "") + ")");
 
-        conn.createStatement().execute("upsert into rtrim_test (k) values ('a')");
-        conn.createStatement().execute("upsert into rtrim_test (k) values ('b')");
-        conn.createStatement().execute("upsert into rtrim_test (k) values ('b ')");
-        conn.createStatement().execute("upsert into rtrim_test (k) values ('b  ')");
-        conn.createStatement().execute("upsert into rtrim_test (k) values ('b  a')");
-        conn.createStatement().execute("upsert into rtrim_test (k) values (' b  ')");
-        conn.createStatement().execute("upsert into rtrim_test (k) values ('c')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values ('a')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values ('b')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values ('b ')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values ('b  ')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values ('b  a')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values (' b  ')");
+        conn.createStatement().execute("upsert into " + tableName + " (k) values ('c')");
         conn.commit();
 
-        String query = "select k from rtrim_test WHERE rtrim(k)='b'";
+        String query = "select k from " + tableName + " WHERE rtrim(k)='b'";
         ResultSet rs = conn.createStatement().executeQuery(query);
         assertValueEqualsResultSet(rs, expectedResults);
         
         rs = conn.createStatement().executeQuery("explain " + query);
-        assertTrue(QueryUtil.getExplainPlan(rs).contains("RANGE SCAN OVER RTRIM_TEST"));
+        assertTrue(QueryUtil.getExplainPlan(rs).contains("RANGE SCAN OVER " + tableName));
         
         conn.close();
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReadOnlyIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReadOnlyIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReadOnlyIT.java
index bcc4ee8..0b86af0 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReadOnlyIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReadOnlyIT.java
@@ -32,19 +32,20 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.junit.Test;
 
 
-public class ReadOnlyIT extends BaseHBaseManagedTimeIT {
+public class ReadOnlyIT extends BaseHBaseManagedTimeTableReuseIT {
 
     @Test
     public void testConnectionReadOnly() throws Exception {
         
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
-        String ddl = "CREATE TABLE test_table " +
+      String testTable = generateRandomString();
+      String ddl = "CREATE TABLE " + testTable + " " +
                         "  (r varchar not null, col1 integer" +
                         "  CONSTRAINT pk PRIMARY KEY (r))\n"; 
         createTestTable(getUrl(), ddl);
 
-        String query = "UPSERT INTO test_table(r, col1) VALUES('row1', 777)";
+        String query = "UPSERT INTO " + testTable + "(r, col1) VALUES('row1', 777)";
         PreparedStatement statement = conn.prepareStatement(query);
         statement.executeUpdate();
         conn.commit();
@@ -52,7 +53,7 @@ public class ReadOnlyIT extends BaseHBaseManagedTimeIT {
 	try{    
 		conn.setReadOnly(true);
                 assertTrue(conn.isReadOnly());
-		ddl = "CREATE TABLE test_table2 " +
+		ddl = "CREATE TABLE " + testTable + "2 " +
 				"  (r varchar not null, col1 integer" +
 				"  CONSTRAINT pk PRIMARY KEY (r))\n";
 		statement = conn.prepareStatement(ddl);
@@ -63,8 +64,8 @@ public class ReadOnlyIT extends BaseHBaseManagedTimeIT {
               assertTrue(e.getMessage(), e.getMessage().contains("ERROR 518 (25502): Mutations are not permitted for a read-only connection."));
         }
 	  
-	try {  
-                query = "UPSERT INTO test_table(r, col1) VALUES('row1', 888)";
+	try {
+                query = "UPSERT INTO " + testTable + "(r, col1) VALUES('row1', 888)";
                 statement = conn.prepareStatement(query);
                 statement.executeUpdate();
                 conn.commit();
@@ -75,14 +76,14 @@ public class ReadOnlyIT extends BaseHBaseManagedTimeIT {
 
 	conn.setReadOnly(false);
         assertFalse(conn.isReadOnly());
-        ddl = "ALTER TABLE test_table ADD col2 VARCHAR";
+        ddl = "ALTER TABLE " + testTable + " ADD col2 VARCHAR";
 	statement = conn.prepareStatement(ddl);
         statement.executeUpdate();
 	conn.commit();
 
         try {   
 		conn.setReadOnly(true);
-                ddl = "ALTER TABLE test_table ADD col3 VARCHAR";
+                ddl = "ALTER TABLE " + testTable + " ADD col3 VARCHAR";
 		statement = conn.prepareStatement(ddl);
         	statement.executeUpdate();
                 fail();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/RegexpSplitFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RegexpSplitFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RegexpSplitFunctionIT.java
index 5170089..50b7a80 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RegexpSplitFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RegexpSplitFunctionIT.java
@@ -31,23 +31,32 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Types;
 
+import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 
-public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
+public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeTableReuseIT {
+
+    private static final String SPLIT_TEST = generateRandomString();
+
+    @BeforeClass
+    public static void setup() throws Exception {
+        Connection conn = DriverManager.getConnection(getUrl());
+        String ddl = "CREATE TABLE " + SPLIT_TEST + " (" +
+            "ID INTEGER NOT NULL PRIMARY KEY," +
+            "VAL VARCHAR," +
+            "SEP VARCHAR," +
+            "ARR VARCHAR ARRAY)";
+        conn.createStatement().execute(ddl);
+    }
 
     private void initTable(Connection conn, String val) throws SQLException {
         initTable(conn, val, ",");
     }
 
     private void initTable(Connection conn, String val, String separator) throws SQLException {
-        String ddl = "CREATE TABLE SPLIT_TEST (" +
-                "ID INTEGER NOT NULL PRIMARY KEY," +
-                "VAL VARCHAR," +
-                "SEP VARCHAR," +
-                "ARR VARCHAR ARRAY)";
-        conn.createStatement().execute(ddl);
-        String dml = "UPSERT INTO SPLIT_TEST (ID, SEP, VAL) VALUES (?, ?, ?)";
+        String dml = "UPSERT INTO " + SPLIT_TEST + " (ID, SEP, VAL) VALUES (?, ?, ?)";
         PreparedStatement stmt = conn.prepareStatement(dml);
         stmt.setInt(1, 1);
         if (separator == null) {
@@ -70,7 +79,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE,TWO,THREE");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, ',')[1] FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, ',')[1] FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         assertEquals("ONE", rs.getString(1));
         assertFalse(rs.next());
@@ -82,7 +91,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE,TWO,THREE");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT ID FROM SPLIT_TEST WHERE (REGEXP_SPLIT(VAL, ','))[1] = 'ONE'");
+            "SELECT ID FROM " + SPLIT_TEST + " WHERE (REGEXP_SPLIT(VAL, ','))[1] = 'ONE'");
         assertTrue(rs.next());
         assertEquals(1, rs.getInt(1));
         assertFalse(rs.next());
@@ -93,11 +102,12 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         Connection conn = DriverManager.getConnection(getUrl());
         initTable(conn, "ONE,TWO,THREE");
 
-        conn.createStatement().executeUpdate("UPSERT INTO SPLIT_TEST (ID, ARR) SELECT ID, " +
-                "REGEXP_SPLIT(VAL, ',') FROM SPLIT_TEST");
+        conn.createStatement().executeUpdate(
+            "UPSERT INTO " + SPLIT_TEST + " (ID, ARR) SELECT ID, " + "REGEXP_SPLIT(VAL, ',') FROM "
+                + SPLIT_TEST);
         conn.commit();
 
-        ResultSet rs = conn.createStatement().executeQuery("SELECT ARR FROM SPLIT_TEST");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT ARR FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         Array array = rs.getArray(1);
         String[] values = (String[]) array.getArray();
@@ -110,7 +120,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE:TWO:THREE");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, ':') FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, ':') FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         Array array = rs.getArray(1);
         String[] values = (String[]) array.getArray();
@@ -123,7 +133,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE,TWO,THREE");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, SEP) FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, SEP) FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         Array array = rs.getArray(1);
         String[] values = (String[]) array.getArray();
@@ -136,7 +146,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "CANNOT BE SPLIT");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, ',') FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, ',') FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         Array array = rs.getArray(1);
         String[] values = (String[]) array.getArray();
@@ -149,7 +159,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE!:TWO:::!THREE::!:FOUR");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, '[:!]+') FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, '[:!]+') FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         Array array = rs.getArray(1);
         String[] values = (String[]) array.getArray();
@@ -162,7 +172,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE|TWO|THREE");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, '\\\\|') FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, '\\\\|') FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         Array array = rs.getArray(1);
         String[] values = (String[]) array.getArray();
@@ -175,7 +185,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, null);
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, ',') FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, ',') FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         assertNull(rs.getString(1));
         assertFalse(rs.next());
@@ -187,7 +197,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE,TWO,THREE");
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, NULL) FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, NULL) FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         assertNull(rs.getString(1));
         assertFalse(rs.next());
@@ -199,7 +209,7 @@ public class RegexpSplitFunctionIT extends BaseHBaseManagedTimeIT {
         initTable(conn, "ONE,TWO,THREE", null);
 
         ResultSet rs = conn.createStatement().executeQuery(
-                "SELECT REGEXP_SPLIT(VAL, SEP) FROM SPLIT_TEST");
+            "SELECT REGEXP_SPLIT(VAL, SEP) FROM " + SPLIT_TEST);
         assertTrue(rs.next());
         assertNull(rs.getString(1));
         assertFalse(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseFunctionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseFunctionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseFunctionIT.java
index f384d3a..3a1f8c2 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseFunctionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ReverseFunctionIT.java
@@ -30,28 +30,32 @@ import java.sql.ResultSet;
 import org.junit.Test;
 
 
-public class ReverseFunctionIT extends BaseHBaseManagedTimeIT {
-    private void initTable(Connection conn, String sortOrder, String s) throws Exception {
-        String ddl = "CREATE TABLE REVERSE_TEST (pk VARCHAR NOT NULL PRIMARY KEY " + sortOrder + ", kv VARCHAR)";
+public class ReverseFunctionIT extends BaseHBaseManagedTimeTableReuseIT {
+
+    private String initTable(Connection conn, String sortOrder, String s) throws Exception {
+        String reverseTest =  generateRandomString();
+        String ddl = "CREATE TABLE " + reverseTest + " (pk VARCHAR NOT NULL PRIMARY KEY " + sortOrder + ", kv VARCHAR)";
         conn.createStatement().execute(ddl);
-        String dml = "UPSERT INTO REVERSE_TEST VALUES(?)";
+        String dml = "UPSERT INTO " + reverseTest + " VALUES(?)";
         PreparedStatement stmt = conn.prepareStatement(dml);
         stmt.setString(1, s);
         stmt.execute();
-        conn.commit();        
+        conn.commit();
+        return reverseTest;
     }
     
-    private void testReverse(Connection conn, String s) throws Exception {
+    private void testReverse(Connection conn, String s, String tableName) throws Exception {
         StringBuilder buf = new StringBuilder(s);
         String reverse = buf.reverse().toString();
         
         ResultSet rs;
-        rs = conn.createStatement().executeQuery("SELECT reverse(pk) FROM REVERSE_TEST");
+        rs = conn.createStatement().executeQuery("SELECT reverse(pk) FROM " + tableName);
         assertTrue(rs.next());
         assertEquals(reverse, rs.getString(1));
         assertFalse(rs.next());
         
-        PreparedStatement stmt = conn.prepareStatement("SELECT pk FROM REVERSE_TEST WHERE pk=reverse(?)");
+        PreparedStatement stmt = conn.prepareStatement(
+            "SELECT pk FROM " + tableName + " WHERE pk=reverse(?)");
         stmt.setString(1, reverse);
         rs = stmt.executeQuery();
         assertTrue(rs.next());
@@ -63,16 +67,16 @@ public class ReverseFunctionIT extends BaseHBaseManagedTimeIT {
     public void testSingleByteReverseAscending() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         String s = "abc";
-        initTable(conn, "ASC", s);
-        testReverse(conn, s);
+        String tableName = initTable(conn, "ASC", s);
+        testReverse(conn, s, tableName);
     }                                                           
 
     @Test
     public void testMultiByteReverseAscending() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         String s = "ɚɦɰɸ";
-        initTable(conn, "DESC", s);
-        testReverse(conn, s);
+        String tableName = initTable(conn, "DESC", s);
+        testReverse(conn, s, tableName);
     }                                                           
 
     
@@ -80,26 +84,26 @@ public class ReverseFunctionIT extends BaseHBaseManagedTimeIT {
     public void testSingleByteReverseDecending() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         String s = "abc";
-        initTable(conn, "DESC", s);
-        testReverse(conn, s);
+        String tableName = initTable(conn, "DESC", s);
+        testReverse(conn, s, tableName);
     }                                                           
 
     @Test
     public void testMultiByteReverseDecending() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         String s = "ɚɦɰɸ";
-        initTable(conn, "ASC", s);
-        testReverse(conn, s);
+        String tableName = initTable(conn, "ASC", s);
+        testReverse(conn, s, tableName);
     }
     
     @Test
     public void testNullReverse() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         String s = "abc";
-        initTable(conn, "ASC", s);
-        
+        String tableName = initTable(conn, "ASC", s);
+
         ResultSet rs;
-        rs = conn.createStatement().executeQuery("SELECT reverse(kv) FROM REVERSE_TEST");
+        rs = conn.createStatement().executeQuery("SELECT reverse(kv) FROM " + tableName);
         assertTrue(rs.next());
         assertNull(rs.getString(1));
         assertFalse(rs.next());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFunctionsEnd2EndIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFunctionsEnd2EndIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFunctionsEnd2EndIT.java
index 753d592..c365934 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFunctionsEnd2EndIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RoundFloorCeilFunctionsEnd2EndIT.java
@@ -55,9 +55,10 @@ import com.google.common.primitives.Floats;
  */
 
 
-public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
-    
-    private static long millisPart = 660;
+public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeTableReuseIT {
+
+  private static final String TABLE_NAME = generateRandomString();
+  private static long millisPart = 660;
     private static int nanosPart = 500100;
     private static BigDecimal decimalUpserted = BigDecimal.valueOf(1.264);
     private static double doubleUpserted = 1.264d;
@@ -72,7 +73,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
         PreparedStatement stmt = null;
         try {
             conn = DriverManager.getConnection(getUrl());
-            String ddl = "CREATE TABLE IF NOT EXISTS t1 (s VARCHAR NOT NULL PRIMARY KEY, dt DATE, t TIME, ts TIMESTAMP, dec DECIMAL, doub DOUBLE, undoub UNSIGNED_DOUBLE, fl FLOAT, unfl UNSIGNED_FLOAT)";
+            String ddl = "CREATE TABLE IF NOT EXISTS " + TABLE_NAME
+                + " (s VARCHAR NOT NULL PRIMARY KEY, dt DATE, t TIME, ts TIMESTAMP, dec DECIMAL, doub DOUBLE, undoub UNSIGNED_DOUBLE, fl FLOAT, unfl UNSIGNED_FLOAT)";
             conn.createStatement().execute(ddl);
             
             Date dateUpserted = DateUtil.parseDate("2012-01-01 14:25:28");
@@ -82,7 +84,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
             Time timeUpserted = new Time(millis);
             Timestamp tsUpserted = DateUtil.getTimestamp(millis, nanosPart);
             
-            stmt =  conn.prepareStatement("UPSERT INTO t1 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
+            stmt =  conn.prepareStatement(
+                "UPSERT INTO " + TABLE_NAME + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
             stmt.setString(1, testString);
             stmt.setDate(2, dateUpserted);
             stmt.setTime(3, timeUpserted);
@@ -103,7 +106,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testRoundingUpDate() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(dt, 'day'), ROUND(dt, 'hour', 1), ROUND(dt, 'minute', 1), ROUND(dt, 'second', 1), "
-                + " ROUND(dt,'week'), ROUND(dt,'month') , ROUND(dt,'year') FROM t1");
+                + " ROUND(dt,'week'), ROUND(dt,'month') , ROUND(dt,'year') FROM " + TABLE_NAME);
         assertTrue(rs.next());
         Date expectedDate = DateUtil.parseDate("2012-01-02 00:00:00");
         assertEquals(expectedDate, rs.getDate(1));
@@ -124,7 +127,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testRoundingUpDateInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE ROUND(dt, 'day') = to_date('2012-01-02 00:00:00')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE ROUND(dt, 'day') = to_date('2012-01-02 00:00:00')");
         assertTrue(rs.next());
     }
     
@@ -132,7 +136,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testFloorDate() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT FLOOR(dt, 'day', 1), FLOOR(dt, 'hour', 1), FLOOR(dt, 'minute', 1), FLOOR(dt, 'second', 1),"
-                + " FLOOR(dt,'week'), FLOOR(dt,'month'), FLOOR(dt,'year') FROM t1");
+                + " FLOOR(dt,'week'), FLOOR(dt,'month'), FLOOR(dt,'year') FROM " + TABLE_NAME);
         assertTrue(rs.next());
         Date expectedDate = DateUtil.parseDate("2012-01-01 00:00:00");
         assertEquals(expectedDate, rs.getDate(1));
@@ -153,7 +157,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testFloorDateInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE FLOOR(dt, 'hour') = to_date('2012-01-01 14:00:00')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE FLOOR(dt, 'hour') = to_date('2012-01-01 14:00:00')");
         assertTrue(rs.next());
     }
     
@@ -161,7 +166,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testCeilDate() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT CEIL(dt, 'day', 1), CEIL(dt, 'hour', 1), CEIL(dt, 'minute', 1), CEIL(dt, 'second', 1), "
-                + " CEIL(dt,'week') , CEIL(dt,'month') , CEIL(dt,'year')  FROM t1");
+                + " CEIL(dt,'week') , CEIL(dt,'month') , CEIL(dt,'year')  FROM " + TABLE_NAME);
         assertTrue(rs.next());
         //Date upserted is 2012-01-01 14:25:28.660. So we will end up bumping up in every case.
         Date expectedDate = DateUtil.parseDate("2012-01-02 00:00:00");
@@ -184,14 +189,17 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testCeilDateInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE CEIL(dt, 'second') = to_date('2012-01-01 14:25:29')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE CEIL(dt, 'second') = to_date('2012-01-01 14:25:29')");
         assertTrue(rs.next());
     }
     
     @Test
     public void testRoundingUpTimestamp() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(ts, 'day'), ROUND(ts, 'hour', 1), ROUND(ts, 'minute', 1), ROUND(ts, 'second', 1), ROUND(ts, 'millisecond', 1) FROM t1");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT ROUND(ts, 'day'), ROUND(ts, 'hour', 1), ROUND(ts, 'minute', 1), ROUND(ts, 'second', 1), ROUND(ts, 'millisecond', 1) FROM "
+                + TABLE_NAME);
         assertTrue(rs.next());
         Timestamp expectedTimestamp;
         expectedTimestamp = new Timestamp(DateUtil.parseDate("2012-01-02 00:00:00").getTime());
@@ -212,7 +220,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testRoundingUpTimestampInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE ROUND(ts, 'second') = to_date('2012-01-01 14:25:29')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE ROUND(ts, 'second') = to_date('2012-01-01 14:25:29')");
         assertTrue(rs.next());
     }
     
@@ -220,7 +229,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testFloorTimestamp() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT FLOOR(ts, 'day'), FLOOR(ts, 'hour', 1), FLOOR(ts, 'minute', 1), FLOOR(ts, 'second', 1), "
-                + " FLOOR(ts, 'millisecond', 1) , FLOOR(ts,'week') , FLOOR(ts,'month') FROM t1");
+                + " FLOOR(ts, 'millisecond', 1) , FLOOR(ts,'week') , FLOOR(ts,'month') FROM "
+            + TABLE_NAME);
         assertTrue(rs.next());
         Timestamp expectedTimestamp;
         expectedTimestamp = new Timestamp(DateUtil.parseDate("2012-01-01 00:00:00").getTime());
@@ -244,14 +254,16 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testFloorTimestampInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE FLOOR(ts, 'second') = to_date('2012-01-01 14:25:28')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE FLOOR(ts, 'second') = to_date('2012-01-01 14:25:28')");
         assertTrue(rs.next());
     }
     
     @Test
     public void testWeekFloorTimestampInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE FLOOR(ts, 'week') = to_date('2011-12-26 00:00:00')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE FLOOR(ts, 'week') = to_date('2011-12-26 00:00:00')");
         assertTrue(rs.next());
     }
     
@@ -259,7 +271,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testCeilTimestamp() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT CEIL(ts, 'day'), CEIL(ts, 'hour', 1), CEIL(ts, 'minute', 1), CEIL(ts, 'second', 1), CEIL(ts, 'millisecond', 1),"
-                + " CEIL(ts,'week'), CEIL(ts,'month') , CEIL(ts,'year') FROM t1");
+                + " CEIL(ts,'week'), CEIL(ts,'month') , CEIL(ts,'year') FROM " + TABLE_NAME);
         assertTrue(rs.next());
         Timestamp expectedTimestamp;
         expectedTimestamp = new Timestamp(DateUtil.parseDate("2012-01-02 00:00:00").getTime());
@@ -286,7 +298,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testCeilTimestampInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE CEIL(ts, 'second') = to_date('2012-01-01 14:25:29')");
+        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM " + TABLE_NAME
+            + " WHERE CEIL(ts, 'second') = to_date('2012-01-01 14:25:29')");
         assertTrue(rs.next());
     }
     
@@ -294,7 +307,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testRoundingUpTime() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(t, 'day', 1), ROUND(t, 'hour', 1), ROUND(t, 'minute', 1), ROUND(t, 'second', 1),"
-                + " ROUND(t,'week') , ROUND(t,'month') , ROUND(t,'year') FROM t1");
+                + " ROUND(t,'week') , ROUND(t,'month') , ROUND(t,'year') FROM " + TABLE_NAME);
         assertTrue(rs.next());
         Time expectedTime = new Time(DateUtil.parseDate("2012-01-02 00:00:00").getTime());
         assertEquals(expectedTime, rs.getTime(1));
@@ -316,7 +329,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testFloorTime() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT FLOOR(t, 'day', 1), FLOOR(t, 'hour', 1), FLOOR(t, 'minute', 1), FLOOR(t, 'second', 1), "
-                + " FLOOR(t, 'week'),  FLOOR(t, 'month'), FLOOR(t, 'year') FROM t1");
+                + " FLOOR(t, 'week'),  FLOOR(t, 'month'), FLOOR(t, 'year') FROM " + TABLE_NAME);
         assertTrue(rs.next());
         Time expectedTime = new Time(DateUtil.parseDate("2012-01-01 00:00:00").getTime());
         assertEquals(expectedTime, rs.getTime(1));
@@ -338,7 +351,7 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     public void testCeilTime() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
         ResultSet rs = conn.createStatement().executeQuery("SELECT CEIL(t, 'day', 1), CEIL(t, 'hour', 1), CEIL(t, 'minute', 1), CEIL(t, 'second', 1),"
-                + " CEIL(t,'week') , CEIL(t,'month') , CEIL(t,'year') FROM t1");
+                + " CEIL(t,'week') , CEIL(t,'month') , CEIL(t,'year') FROM " + TABLE_NAME);
         assertTrue(rs.next());
         Time expectedTime = new Time(DateUtil.parseDate("2012-01-02 00:00:00").getTime());
         assertEquals(expectedTime, rs.getTime(1));
@@ -359,7 +372,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testRoundingUpDecimal() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(dec), ROUND(dec, 1), ROUND(dec, 2), ROUND(dec, 3) FROM t1");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT ROUND(dec), ROUND(dec, 1), ROUND(dec, 2), ROUND(dec, 3) FROM " + TABLE_NAME);
         assertTrue(rs.next());
         BigDecimal expectedBd = BigDecimal.valueOf(1);
         assertEquals(expectedBd, rs.getBigDecimal(1));
@@ -374,14 +388,16 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testRoundingUpDecimalInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE ROUND(dec, 2) = 1.26");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT * FROM " + TABLE_NAME + " WHERE ROUND(dec, 2) = 1.26");
         assertTrue(rs.next());
     }
     
     @Test
     public void testFloorDecimal() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT FLOOR(dec), FLOOR(dec, 1), FLOOR(dec, 2), FLOOR(dec, 3) FROM t1");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT FLOOR(dec), FLOOR(dec, 1), FLOOR(dec, 2), FLOOR(dec, 3) FROM " + TABLE_NAME);
         assertTrue(rs.next());
         BigDecimal expectedBd = BigDecimal.valueOf(1);
         assertEquals(expectedBd, rs.getBigDecimal(1));
@@ -396,14 +412,16 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testFloorDecimalInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE FLOOR(dec, 2) = 1.26");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT * FROM " + TABLE_NAME + " WHERE FLOOR(dec, 2) = 1.26");
         assertTrue(rs.next());
     }
     
     @Test
     public void testCeilDecimal() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT CEIL(dec), CEIL(dec, 1), CEIL(dec, 2), CEIL(dec, 3) FROM t1");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT CEIL(dec), CEIL(dec, 1), CEIL(dec, 2), CEIL(dec, 3) FROM " + TABLE_NAME);
         assertTrue(rs.next());
         BigDecimal expectedBd = BigDecimal.valueOf(2);
         assertEquals(expectedBd, rs.getBigDecimal(1));
@@ -418,13 +436,15 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
     @Test
     public void testCeilDecimalInWhere() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE CEIL(dec, 2) = 1.27");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT * FROM " + TABLE_NAME + " WHERE CEIL(dec, 2) = 1.27");
         assertTrue(rs.next());
     }
     @Test
 	public void testRoundingUpDouble() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(doub), ROUND(doub, 1), ROUND(doub, 2), ROUND(doub, 3) FROM t1");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT ROUND(doub), ROUND(doub, 1), ROUND(doub, 2), ROUND(doub, 3) FROM " + TABLE_NAME);
 		assertTrue(rs.next());
 		assertEquals(0, Doubles.compare(1, rs.getDouble(1)));
 		assertEquals(0, Doubles.compare(1.3, rs.getDouble(2)));
@@ -435,14 +455,16 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
 	@Test
 	public void testRoundingUpDoubleInWhere() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE ROUND(dec, 2) = 1.26");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT * FROM " + TABLE_NAME + " WHERE ROUND(dec, 2) = 1.26");
 		assertTrue(rs.next());
 	}
 
 	@Test
 	public void testCeilDouble() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT CEIL(doub), CEIL(doub, 1), CEIL(doub, 2), CEIL(doub, 3) FROM t1");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT CEIL(doub), CEIL(doub, 1), CEIL(doub, 2), CEIL(doub, 3) FROM " + TABLE_NAME);
 		assertTrue(rs.next());
 		assertEquals(0, Doubles.compare(2, rs.getDouble(1)));
 		assertEquals(0, Doubles.compare(1.3, rs.getDouble(2)));
@@ -453,14 +475,16 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
 	@Test
 	public void testCeilDoubleInWhere() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE CEIL(doub, 2) = 1.27");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT * FROM " + TABLE_NAME + " WHERE CEIL(doub, 2) = 1.27");
 		assertTrue(rs.next());
 	}
 
 	@Test
 	public void testFloorDouble() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT FLOOR(doub), FLOOR(doub, 1), FLOOR(doub, 2), FLOOR(doub, 3) FROM t1");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT FLOOR(doub), FLOOR(doub, 1), FLOOR(doub, 2), FLOOR(doub, 3) FROM " + TABLE_NAME);
 		assertTrue(rs.next());
 		assertEquals(0, Doubles.compare(1, rs.getDouble(1)));
 		assertEquals(0, Doubles.compare(1.2, rs.getDouble(2)));
@@ -471,14 +495,16 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
 	@Test
 	public void testFloorDoubleInWhere() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM t1 WHERE FLOOR(doub, 2) = 1.26");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT * FROM " + TABLE_NAME + " WHERE FLOOR(doub, 2) = 1.26");
 		assertTrue(rs.next());
 	}
 	
 	@Test
 	public void testRoundFloat() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(fl), ROUND(fl, 1), ROUND(fl, 2), ROUND(fl, 3) FROM t1");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT ROUND(fl), ROUND(fl, 1), ROUND(fl, 2), ROUND(fl, 3) FROM " + TABLE_NAME);
 		assertTrue(rs.next());
 		assertEquals(0, Floats.compare(1, rs.getFloat(1)));
 		assertEquals(0, Floats.compare(1.3f, rs.getFloat(2)));
@@ -489,7 +515,8 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
 	@Test
 	public void testRoundUnsignedFloat() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(unfl), ROUND(unfl, 1), ROUND(unfl, 2), ROUND(unfl, 3) FROM t1");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT ROUND(unfl), ROUND(unfl, 1), ROUND(unfl, 2), ROUND(unfl, 3) FROM " + TABLE_NAME);
 		assertTrue(rs.next());
 		assertEquals(0, Floats.compare(1, rs.getFloat(1)));
 		assertEquals(0, Floats.compare(1.3f, rs.getFloat(2)));
@@ -500,7 +527,9 @@ public class RoundFloorCeilFunctionsEnd2EndIT extends BaseHBaseManagedTimeIT {
 	@Test
 	public void testRoundUnsignedDouble() throws Exception {
 		Connection conn = DriverManager.getConnection(getUrl());
-		ResultSet rs = conn.createStatement().executeQuery("SELECT ROUND(undoub), ROUND(undoub, 1), ROUND(undoub, 2), ROUND(undoub, 3) FROM t1");
+		ResultSet rs = conn.createStatement().executeQuery(
+        "SELECT ROUND(undoub), ROUND(undoub, 1), ROUND(undoub, 2), ROUND(undoub, 3) FROM "
+            + TABLE_NAME);
 		assertTrue(rs.next());
 		assertEquals(0, Floats.compare(1, rs.getFloat(1)));
 		assertEquals(0, Floats.compare(1.3f, rs.getFloat(2)));

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/ServerExceptionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ServerExceptionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ServerExceptionIT.java
index 5c8679d..e4f3c1d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ServerExceptionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ServerExceptionIT.java
@@ -32,7 +32,7 @@ import org.apache.phoenix.util.PropertiesUtil;
 import org.junit.Test;
 
 
-public class ServerExceptionIT extends BaseHBaseManagedTimeIT {
+public class ServerExceptionIT extends BaseHBaseManagedTimeTableReuseIT {
 
     @Test
     public void testServerExceptionBackToClient() throws Exception {
@@ -40,11 +40,12 @@ public class ServerExceptionIT extends BaseHBaseManagedTimeIT {
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
         try {
-            String ddl = "CREATE TABLE IF NOT EXISTS t1(pk VARCHAR NOT NULL PRIMARY KEY, " +
+            String t1 = generateRandomString();
+            String ddl = "CREATE TABLE IF NOT EXISTS " + t1 + "(pk VARCHAR NOT NULL PRIMARY KEY, " +
                     "col1 INTEGER, col2 INTEGER)";
             createTestTable(getUrl(), ddl);
             
-            String query = "UPSERT INTO t1 VALUES(?,?,?)";
+            String query = "UPSERT INTO " + t1 + " VALUES(?,?,?)";
             PreparedStatement stmt = conn.prepareStatement(query);
             stmt.setString(1, "1");
             stmt.setInt(2, 1);
@@ -52,7 +53,7 @@ public class ServerExceptionIT extends BaseHBaseManagedTimeIT {
             stmt.execute();
             conn.commit();
             
-            query = "SELECT * FROM t1 where col1/col2 > 0";
+            query = "SELECT * FROM " + t1 + " where col1/col2 > 0";
             stmt = conn.prepareStatement(query);
             ResultSet rs = stmt.executeQuery();
             rs.next();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6d147896/phoenix-core/src/it/java/org/apache/phoenix/end2end/SignFunctionEnd2EndIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SignFunctionEnd2EndIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SignFunctionEnd2EndIT.java
index 6634d23..5c86955 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SignFunctionEnd2EndIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SignFunctionEnd2EndIT.java
@@ -29,26 +29,31 @@ import java.sql.ResultSet;
 
 import org.apache.phoenix.expression.function.SignFunction;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
  * End to end tests for {@link SignFunction}
  * @since 4.0.0
  */
-public class SignFunctionEnd2EndIT extends BaseHBaseManagedTimeIT {
+public class SignFunctionEnd2EndIT extends BaseHBaseManagedTimeTableReuseIT {
 
     private static final String KEY = "key";
+    private static final String TEST_SIGNED = generateRandomString();
+    private static final String TEST_UNSIGNED = generateRandomString();
 
-    @Before
-    public void initTable() throws Exception {
+    @BeforeClass
+    public static void initTable() throws Exception {
         Connection conn = null;
         PreparedStatement stmt = null;
         try {
             conn = DriverManager.getConnection(getUrl());
             String ddl;
-            ddl = "CREATE TABLE testSigned (k VARCHAR NOT NULL PRIMARY KEY, dec DECIMAL, doub DOUBLE, fl FLOAT, inte INTEGER, lon BIGINT, smalli SMALLINT, tinyi TINYINT)";
+            ddl = "CREATE TABLE " + TEST_SIGNED
+                + " (k VARCHAR NOT NULL PRIMARY KEY, dec DECIMAL, doub DOUBLE, fl FLOAT, inte INTEGER, lon BIGINT, smalli SMALLINT, tinyi TINYINT)";
             conn.createStatement().execute(ddl);
-            ddl = "CREATE TABLE testUnsigned (k VARCHAR NOT NULL PRIMARY KEY, doub UNSIGNED_DOUBLE, fl UNSIGNED_FLOAT, inte UNSIGNED_INT, lon UNSIGNED_LONG, smalli UNSIGNED_SMALLINT, tinyi UNSIGNED_TINYINT)";
+            ddl = "CREATE TABLE " + TEST_UNSIGNED
+                + " (k VARCHAR NOT NULL PRIMARY KEY, doub UNSIGNED_DOUBLE, fl UNSIGNED_FLOAT, inte UNSIGNED_INT, lon UNSIGNED_LONG, smalli UNSIGNED_SMALLINT, tinyi UNSIGNED_TINYINT)";
             conn.createStatement().execute(ddl);
             conn.commit();
         } finally {
@@ -57,7 +62,8 @@ public class SignFunctionEnd2EndIT extends BaseHBaseManagedTimeIT {
     }
 
     private void updateSignedTable(Connection conn, double data) throws Exception {
-        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO testSigned VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
+        PreparedStatement stmt = conn.prepareStatement(
+            "UPSERT INTO " + TEST_SIGNED + " VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
         stmt.setString(1, KEY);
         Double d = Double.valueOf(data);
         stmt.setBigDecimal(2, BigDecimal.valueOf(data));
@@ -72,7 +78,8 @@ public class SignFunctionEnd2EndIT extends BaseHBaseManagedTimeIT {
     }
 
     private void updateUnsignedTable(Connection conn, double data) throws Exception {
-        PreparedStatement stmt = conn.prepareStatement("UPSERT INTO testUnsigned VALUES (?, ?, ?, ?, ?, ?, ?)");
+        PreparedStatement stmt = conn.prepareStatement(
+            "UPSERT INTO " + TEST_UNSIGNED + " VALUES (?, ?, ?, ?, ?, ?, ?)");
         stmt.setString(1, KEY);
         Double d = Double.valueOf(data);
         stmt.setDouble(2, d.doubleValue());
@@ -87,14 +94,17 @@ public class SignFunctionEnd2EndIT extends BaseHBaseManagedTimeIT {
 
     private void testSignedNumberSpec(Connection conn, double data, int expected) throws Exception {
         updateSignedTable(conn, data);
-        ResultSet rs = conn.createStatement().executeQuery("SELECT SIGN(dec),SIGN(doub),SIGN(fl),SIGN(inte),SIGN(lon),SIGN(smalli),SIGN(tinyi) FROM testSigned");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT SIGN(dec),SIGN(doub),SIGN(fl),SIGN(inte),SIGN(lon),SIGN(smalli),SIGN(tinyi) FROM "
+                + TEST_SIGNED);
         assertTrue(rs.next());
         for (int i = 1; i <= 7; ++i) {
             assertEquals(rs.getInt(i), expected);
         }
         assertTrue(!rs.next());
 
-        PreparedStatement stmt = conn.prepareStatement("SELECT k FROM testSigned WHERE SIGN(dec)=? AND SIGN(doub)=? AND SIGN(fl)=? AND SIGN(inte)=? AND SIGN(lon)=? AND SIGN(smalli)=? AND SIGN(tinyi)=?");
+        PreparedStatement stmt = conn.prepareStatement("SELECT k FROM " + TEST_SIGNED
+            + " WHERE SIGN(dec)=? AND SIGN(doub)=? AND SIGN(fl)=? AND SIGN(inte)=? AND SIGN(lon)=? AND SIGN(smalli)=? AND SIGN(tinyi)=?");
         for (int i = 1; i <= 7; ++i)
             stmt.setInt(i, expected);
         rs = stmt.executeQuery();
@@ -105,14 +115,17 @@ public class SignFunctionEnd2EndIT extends BaseHBaseManagedTimeIT {
 
     private void testUnsignedNumberSpec(Connection conn, double data, int expected) throws Exception {
         updateUnsignedTable(conn, data);
-        ResultSet rs = conn.createStatement().executeQuery("SELECT SIGN(doub),SIGN(fl),SIGN(inte),SIGN(lon),SIGN(smalli),SIGN(tinyi) FROM testUnsigned");
+        ResultSet rs = conn.createStatement().executeQuery(
+            "SELECT SIGN(doub),SIGN(fl),SIGN(inte),SIGN(lon),SIGN(smalli),SIGN(tinyi) FROM "
+                + TEST_UNSIGNED);
         assertTrue(rs.next());
         for (int i = 1; i <= 6; ++i) {
             assertEquals(rs.getInt(i), expected);
         }
         assertTrue(!rs.next());
 
-        PreparedStatement stmt = conn.prepareStatement("SELECT k FROM testUnsigned WHERE SIGN(doub)=? AND SIGN(fl)=? AND SIGN(inte)=? AND SIGN(lon)=? AND SIGN(smalli)=? AND SIGN(tinyi)=?");
+        PreparedStatement stmt = conn.prepareStatement("SELECT k FROM " + TEST_UNSIGNED
+            + " WHERE SIGN(doub)=? AND SIGN(fl)=? AND SIGN(inte)=? AND SIGN(lon)=? AND SIGN(smalli)=? AND SIGN(tinyi)=?");
         for (int i = 1; i <= 6; ++i)
             stmt.setInt(i, expected);
         rs = stmt.executeQuery();


Mime
View raw message