use of org.apache.flink.table.planner.plan.schema.FlinkPreparingTableBase in project flink by apache.
the class FlinkCalciteCatalogReaderTest method testGetNonFlinkPreparingTableBase.
@Test
public void testGetNonFlinkPreparingTableBase() {
Table nonFlinkTableMock = mock(Table.class);
when(nonFlinkTableMock.getRowType(typeFactory)).thenReturn(mock(RelDataType.class));
rootSchemaPlus.add(tableMockName, nonFlinkTableMock);
Prepare.PreparingTable resultTable = catalogReader.getTable(Collections.singletonList(tableMockName));
assertFalse(resultTable instanceof FlinkPreparingTableBase);
}
use of org.apache.flink.table.planner.plan.schema.FlinkPreparingTableBase in project flink by apache.
the class FlinkCalciteCatalogReaderTest method testGetFlinkPreparingTableBase.
@Test
public void testGetFlinkPreparingTableBase() {
// Mock CatalogSchemaTable.
final ObjectIdentifier objectIdentifier = ObjectIdentifier.of("a", "b", "c");
final ResolvedSchema schema = new ResolvedSchema(Collections.emptyList(), Collections.emptyList(), null);
final CatalogTable catalogTable = ConnectorCatalogTable.source(new TestTableSource(true, TableSchema.fromResolvedSchema(schema)), true);
final ResolvedCatalogTable resolvedCatalogTable = new ResolvedCatalogTable(catalogTable, schema);
CatalogSchemaTable mockTable = new CatalogSchemaTable(ContextResolvedTable.permanent(objectIdentifier, CatalogManagerMocks.createEmptyCatalog(), resolvedCatalogTable), FlinkStatistic.UNKNOWN(), true);
rootSchemaPlus.add(tableMockName, mockTable);
Prepare.PreparingTable preparingTable = catalogReader.getTable(Collections.singletonList(tableMockName));
assertTrue(preparingTable instanceof FlinkPreparingTableBase);
}
Aggregations