use of org.apache.flink.table.catalog.CatalogManager in project flink by apache.
the class DatabaseCalciteSchemaTest method testTemporaryTableWithPrimaryKey.
@Test
public void testTemporaryTableWithPrimaryKey() {
final CatalogManager catalogManager = CatalogManagerMocks.createEmptyCatalogManager();
final DatabaseCalciteSchema calciteSchema = new DatabaseCalciteSchema("other_catalog", "other_database", catalogManager, true);
catalogManager.createTemporaryTable(createTable(), ObjectIdentifier.of("other_catalog", "other_database", TABLE_NAME), false);
final Table table = calciteSchema.getTable(TABLE_NAME);
assertThat(table, instanceOf(CatalogSchemaTable.class));
assertThat(((CatalogSchemaTable) table).getStatistic().getUniqueKeys().iterator().next(), containsInAnyOrder("a", "b"));
}
Aggregations