docete commented on a change in pull request #11276: 
[FLINK-16029][table-planner-blink] Remove register source and sink in test 
cases of blink planner
URL: https://github.com/apache/flink/pull/11276#discussion_r402725215
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/utils/MemoryTableSourceSinkUtil.scala
 ##########
 @@ -112,29 +78,28 @@ object MemoryTableSourceSinkUtil {
     }
   }
 
-  final class UnsafeMemoryOutputFormatTableSink extends 
OutputFormatTableSink[Row] {
-
-    var fieldNames: Array[String] = _
-    var fieldTypes: Array[TypeInformation[_]] = _
-
-    override def getOutputType: TypeInformation[Row] = {
-      new RowTypeInfo(getTableSchema.getFieldTypes, 
getTableSchema.getFieldNames)
+  final class LegacyUnsafeMemoryAppendTableFactory extends 
StreamTableSinkFactory[Row] {
+    override def createStreamTableSink(
+        properties: util.Map[String, String]): StreamTableSink[Row] = {
+      val dp = new DescriptorProperties
+      dp.putProperties(properties)
+      val tableSchema = dp.getTableSchema(SCHEMA)
+      val sink = new UnsafeMemoryAppendTableSink
+      sink.configure(tableSchema.getFieldNames, tableSchema.getFieldTypes)
+        .asInstanceOf[StreamTableSink[Row]]
     }
 
-    override def getOutputFormat: OutputFormat[Row] = new 
MemoryCollectionOutputFormat
-
-    override def configure(
-        fieldNames: Array[String],
-        fieldTypes: Array[TypeInformation[_]]): TableSink[Row] = {
-      val newSink = new UnsafeMemoryOutputFormatTableSink
-      newSink.fieldNames = fieldNames
-      newSink.fieldTypes = fieldTypes
-      newSink
+    override def requiredContext(): util.Map[String, String] = {
+      val context = new util.HashMap[String, String]()
+      context.put(CONNECTOR_TYPE, "LegacyUnsafeMemoryAppendTable")
 
 Review comment:
   It's not necessary to be a constant field, it's only used in this test case.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to