use of org.apache.phoenix.schema.ColumnAlreadyExistsException in project phoenix by apache.
the class QueryCompilerTest method testDuplicatePKColumn.
@Test
public void testDuplicatePKColumn() throws Exception {
String ddl = "CREATE TABLE t (k1 VARCHAR, k1 VARCHAR CONSTRAINT pk PRIMARY KEY(k1))";
Connection conn = DriverManager.getConnection(getUrl());
try {
conn.createStatement().execute(ddl);
fail();
} catch (ColumnAlreadyExistsException e) {
assertEquals("K1", e.getColumnName());
}
}
use of org.apache.phoenix.schema.ColumnAlreadyExistsException in project phoenix by apache.
the class QueryCompilerTest method testDuplicateKVColumn.
@Test
public void testDuplicateKVColumn() throws Exception {
String ddl = "CREATE TABLE t (k1 VARCHAR, v1 VARCHAR, v2 VARCHAR, v1 INTEGER CONSTRAINT pk PRIMARY KEY(k1))";
Connection conn = DriverManager.getConnection(getUrl());
try {
conn.createStatement().execute(ddl);
fail();
} catch (ColumnAlreadyExistsException e) {
assertEquals("V1", e.getColumnName());
}
}
Aggregations