Source:
<code>public void setup() throws SQLException { <START> prop = new Properties(); <END> conn = DriverManager.getConnection(getUrl(), prop); conn.setAutoCommit(true); conn.createStatement().execute("CREATE TABLE IF NOT EXISTS test.us_population (\n" + " state CHAR(2) NOT NULL,\n" + " city VARCHAR NOT NULL,\n" + " population BIGINT,\n" + " CONSTRAINT my_pk PRIMARY KEY (state, city)) " + tableDDLOptions); if(isViewIndex) { conn.createStatement().execute("CREATE VIEW IF NOT EXISTS test.us_population_gv" + "(city_area INTEGER, avg_fam_size INTEGER) AS " + "SELECT * FROM test.us_population WHERE state = 'CA'"); conn.createStatement().execute("CREATE INDEX IF NOT EXISTS us_population_gv_gi ON " + "test.us_population_gv (city_area) INCLUDE (population)"); conn.createStatement().execute("CREATE INDEX IF NOT EXISTS us_population_gv_gi_2 ON " + "test.us_population_gv (avg_fam_size) INCLUDE (population)"); phoenixObjectName = "test.us_population_gv"; indexesName = "us_population_gv_gi, us_population_gv_gi_2"; } else { conn.createStatement().execute("CREATE INDEX IF NOT EXISTS us_population_gi ON " + "test.us_population (population)"); conn.createStatement().execute("CREATE INDEX IF NOT EXISTS us_population_gi_2 ON " + "test.us_population (state, population)"); phoenixObjectName = "test.us_population"; indexesName = "us_population_gi, us_population_gi_2"; } }</code><technical_language>Please create new tables for test dropping identical tables test. Dropping tables is slow. PHOENIX-5942</technical_language>

Target:
public void setup() throws SQLException { prop = new Properties(); conn = DriverManager.getConnection(getUrl(), prop); conn.setAutoCommit(true); String schemaName = "S_"+generateUniqueName(); String indexNameOne = "I_"+generateUniqueName(); String indexNameTwo = "I_"+generateUniqueName(); String tableName = "T_"+generateUniqueName(); String viewName = "V_"+generateUniqueName(); String fullViewName = SchemaUtil.getQualifiedTableName(schemaName, viewName); String fullTableName = SchemaUtil.getQualifiedTableName(schemaName, tableName); conn.createStatement().execute("CREATE TABLE IF NOT EXISTS " + fullTableName + " (\n" + " state CHAR(2) NOT NULL,\n" + " city VARCHAR NOT NULL,\n" + " population BIGINT,\n" + " CONSTRAINT my_pk PRIMARY KEY (state, city)) " + tableDDLOptions); if(isViewIndex) { conn.createStatement().execute("CREATE VIEW IF NOT EXISTS " + fullViewName + " (city_area INTEGER, avg_fam_size INTEGER) AS " + "SELECT * FROM "+fullTableName+" WHERE state = 'CA'"); conn.createStatement().execute("CREATE INDEX IF NOT EXISTS " + indexNameOne + " ON " + fullViewName+" (city_area) INCLUDE (population)"); conn.createStatement().execute("CREATE INDEX IF NOT EXISTS " + indexNameTwo + " ON " + fullViewName+" (avg_fam_size) INCLUDE (population)"); phoenixObjectName = fullViewName; } else { conn.createStatement().execute("CREATE INDEX IF NOT EXISTS " + indexNameOne + " ON " + fullTableName+" (population)"); conn.createStatement().execute("CREATE INDEX IF NOT EXISTS " + indexNameTwo + " ON " + fullTableName+" (state, population)"); phoenixObjectName = fullTableName; } fullIndexNameOne = SchemaUtil.getQualifiedTableName(schemaName, indexNameOne); fullIndexNameTwo = SchemaUtil.getQualifiedTableName(schemaName, indexNameTwo); indexNames = indexNameOne +", "+indexNameTwo; }