Search in sources :

Example 11 with TableAlreadyExistsException

use of org.apache.phoenix.schema.TableAlreadyExistsException in project phoenix by apache.

the class TenantSpecificTablesDDLIT method testCreateTenantTableTwice.

@Test
public void testCreateTenantTableTwice() throws Exception {
    try {
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL, props);
        conn.createStatement().execute(TENANT_TABLE_DDL);
        fail();
    } catch (TableAlreadyExistsException expected) {
    }
}
Also used : TableAlreadyExistsException(org.apache.phoenix.schema.TableAlreadyExistsException) Connection(java.sql.Connection) PhoenixConnection(org.apache.phoenix.jdbc.PhoenixConnection) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

TableAlreadyExistsException (org.apache.phoenix.schema.TableAlreadyExistsException)11 PhoenixConnection (org.apache.phoenix.jdbc.PhoenixConnection)9 Properties (java.util.Properties)8 Connection (java.sql.Connection)7 NewerTableAlreadyExistsException (org.apache.phoenix.schema.NewerTableAlreadyExistsException)7 Test (org.junit.Test)5 SQLException (java.sql.SQLException)4 ResultSet (java.sql.ResultSet)3 HBaseAdmin (org.apache.hadoop.hbase.client.HBaseAdmin)3 ColumnAlreadyExistsException (org.apache.phoenix.schema.ColumnAlreadyExistsException)3 IOException (java.io.IOException)2 ExecutionException (java.util.concurrent.ExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)2 TableExistsException (org.apache.hadoop.hbase.TableExistsException)2 AccessDeniedException (org.apache.hadoop.hbase.security.AccessDeniedException)2 PhoenixIOException (org.apache.phoenix.exception.PhoenixIOException)2 RetriableUpgradeException (org.apache.phoenix.exception.RetriableUpgradeException)2 UpgradeInProgressException (org.apache.phoenix.exception.UpgradeInProgressException)2 UpgradeNotRequiredException (org.apache.phoenix.exception.UpgradeNotRequiredException)2