use of org.apache.ignite.schema.definition.builder.TableDefinitionBuilder in project ignite-3 by apache.
the class SchemaConfigurationTest method invalidColocationColumns.
/**
* TestInitialSchema.
* TODO Documentation https://issues.apache.org/jira/browse/IGNITE-15859
*/
@Test
public void invalidColocationColumns() {
final TableDefinitionBuilder builder = SchemaBuilders.tableBuilder(SchemaObject.DEFAULT_DATABASE_SCHEMA_NAME, "table1");
assertThrows(IllegalStateException.class, () -> // Declare index column in order.
SchemaBuilders.primaryKey().withColumns("id0", "id1", "id2").withColocationColumns("val").build(), "Schema definition error: All colocation columns must be part of key.");
assertThrows(IllegalStateException.class, () -> // Declare index column in order.
SchemaBuilders.primaryKey().withColumns("id0", "id1", "id2").withColocationColumns("id0, id1, id0").build(), "Schema definition error: Colocation columns must not be duplicated.");
}
Aggregations