@Test public void testGetNonFlinkTable() { Table nonFlinkTableMock = mock(Table.class); when(nonFlinkTableMock.getRowType(typeFactory)).thenReturn(mock(RelDataType.class)); rootSchemaPlus.add(tableMockName, nonFlinkTableMock); Prepare.PreparingTable resultTable = catalogReader.getTable(Arrays.asList(tableMockName)); assertFalse(resultTable instanceof FlinkRelOptTable); }
@Override public Prepare.PreparingTable getTable(List<String> names) { Prepare.PreparingTable originRelOptTable = super.getTable(names); if (originRelOptTable == null) { return null; } else { FlinkTable table = originRelOptTable.unwrap(FlinkTable.class); if (table != null) { return FlinkRelOptTable.create( originRelOptTable.getRelOptSchema(), originRelOptTable.getRowType(), originRelOptTable.getQualifiedName(), table); } else { return originRelOptTable; } } }
FlinkCalciteCatalogReader extends CalciteCatalogReader { @Override public Prepare.PreparingTable getTable(List<String> names) { Prepare.PreparingTable originRelOptTable = super.getTable(names); if (originRelOptTable == null) { return null; } else { FlinkTable table = originRelOptTable.unwrap(FlinkTable.class); if (table != null) { return FlinkRelOptTable.create( originRelOptTable.getRelOptSchema(), originRelOptTable.getRowType(), originRelOptTable.getQualifiedName(), table); } else { return originRelOptTable; } } } }
FlinkCalciteCatalogReader extends CalciteCatalogReader { @Override public Prepare.PreparingTable getTable(List<String> names) { Prepare.PreparingTable originRelOptTable = super.getTable(names); if (originRelOptTable == null) { return null; } else { FlinkTable table = originRelOptTable.unwrap(FlinkTable.class); if (table != null) { return FlinkRelOptTable.create( originRelOptTable.getRelOptSchema(), originRelOptTable.getRowType(), originRelOptTable.getQualifiedName(), table); } else { return originRelOptTable; } } } FlinkCalciteCatalogReader(
		CalciteSchema rootSchema,
		List<List<String>> defaultSchemas,
		RelDataTypeFactory typeFactory,
		CalciteConnectionConfig config); }
FlinkCalciteCatalogReader extends CalciteCatalogReader { @Override public Prepare.PreparingTable getTable(List<String> names) { Prepare.PreparingTable originRelOptTable = super.getTable(names); if (originRelOptTable == null) { return null; } else { FlinkTable table = originRelOptTable.unwrap(FlinkTable.class); if (table != null) { return FlinkRelOptTable.create( originRelOptTable.getRelOptSchema(), originRelOptTable.getRowType(), originRelOptTable.getQualifiedName(), table); } else { return originRelOptTable; } } } FlinkCalciteCatalogReader(
		CalciteSchema rootSchema,
		List<List<String>> defaultSchemas,
		RelDataTypeFactory typeFactory,
		CalciteConnectionConfig config); @Override Prepare.PreparingTable getTable(List<String> names); }
FlinkCalciteCatalogReader extends CalciteCatalogReader { @Override public Prepare.PreparingTable getTable(List<String> names) { Prepare.PreparingTable originRelOptTable = super.getTable(names); if (originRelOptTable == null) { return null; } else { FlinkTable table = originRelOptTable.unwrap(FlinkTable.class); if (table != null) { return FlinkRelOptTable.create( originRelOptTable.getRelOptSchema(), originRelOptTable.getRowType(), originRelOptTable.getQualifiedName(), table); } else { return originRelOptTable; } } } FlinkCalciteCatalogReader(
		CalciteSchema rootSchema,
		List<List<String>> defaultSchemas,
		RelDataTypeFactory typeFactory,
		CalciteConnectionConfig config); @Override Prepare.PreparingTable getTable(List<String> names);  }