twalthr commented on a change in pull request #16594:
URL: https://github.com/apache/flink/pull/16594#discussion_r678021006
##########
File path:
flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/catalog/hive/HiveCatalogITCase.java
##########
@@ -157,37 +155,27 @@ public void testCsvTableViaAPI() throws Exception {
tableEnv.registerCatalog("myhive", hiveCatalog);
tableEnv.useCatalog("myhive");
- TableSchema schema =
+ final TableSchema schema =
TableSchema.builder()
.field("name", DataTypes.STRING())
.field("age", DataTypes.INT())
.build();
- FormatDescriptor format =
- new OldCsv().field("name", Types.STRING()).field("age",
Types.INT());
-
- CatalogTable source =
- new CatalogTableBuilder(
- new FileSystem()
- .path(
- this.getClass()
-
.getResource("/csv/test.csv")
- .getPath()),
- schema)
- .withFormat(format)
- .inAppendMode()
- .withComment("Comment.")
- .build();
+ final Map<String, String> sourceOptions = new HashMap<>();
+ sourceOptions.put("connector.type", "filesystem");
+ sourceOptions.put("connector.path",
getClass().getResource("/csv/test.csv").getPath());
+ sourceOptions.put("format.type", "csv");
+
+ CatalogTable source = new CatalogTableImpl(schema, sourceOptions,
"Comment.");
Review comment:
Makes sense.
##########
File path:
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/plan/batch/sql/TableScanTest.scala
##########
@@ -210,10 +210,13 @@ class TableScanTest extends TableTestBase {
@Test
def testTableApiScanWithTemporaryTable(): Unit = {
- util.tableEnv.connect(new FileSystem().path(tempFolder.newFile.getPath))
- .withFormat(new OldCsv())
- .withSchema(new Schema().field("word", DataTypes.STRING()))
- .createTemporaryTable("t1")
+ util.tableEnv.createTemporaryTable("t1",
TableDescriptor.forConnector("datagen")
+ .schema(api.Schema.newBuilder()
Review comment:
remove `api.` prefix
##########
File path:
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/MemoryTableSourceSinkUtil.scala
##########
@@ -54,27 +56,30 @@ object MemoryTableSourceSinkUtil {
tEnv: TableEnvironment,
schema: TableSchema,
tableName: String): Unit = {
- tEnv.connect(new CustomConnectorDescriptor("DataTypeOutputFormatTable", 1,
false))
- .withSchema(new Schema().schema(schema))
- .createTemporaryTable(tableName)
+ val sink = new DataTypeOutputFormatTableSink(schema)
+
tEnv.asInstanceOf[TableEnvironmentInternal].registerTableSinkInternal(tableName,
sink)
}
def createLegacyUnsafeMemoryAppendTable(
tEnv: TableEnvironment,
schema: TableSchema,
tableName: String): Unit = {
- tEnv.connect(new
CustomConnectorDescriptor("LegacyUnsafeMemoryAppendTable", 1, false))
- .withSchema(new Schema().schema(schema))
- .createTemporaryTable(tableName)
+ tEnv.createTemporaryTable(tableName,
+ TableDescriptor.forConnector("LegacyUnsafeMemoryAppendTable")
+ .schema(schema.toSchema)
+ .build())
+
+ val sink = new UnsafeMemoryAppendTableSink
Review comment:
why are we registering two tables now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]