You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "lsyldliu (via GitHub)" <gi...@apache.org> on 2025/01/03 04:06:37 UTC

Re: [PR] [FLINK-36277][table] Remove all direct uses of `TableEnvironmentInternal#registerTableSourceInternal` in table module [flink]

lsyldliu commented on code in PR #25326:
URL: https://github.com/apache/flink/pull/25326#discussion_r1901450664


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala:
##########
@@ -253,18 +263,121 @@ abstract class TableTestUtilBase(test: TableTestBase, isStreamingMode: Boolean)
       }
       val types = fieldTypes.map(TypeConversions.fromLegacyInfoToDataType)
       val names = FieldInfoUtils.getFieldNames(typeInfo)
-      TableSchema.builder().fields(names, types).build()
+      TableSchema.builder().fields(names, types).build().toSchema

Review Comment:
   Why here still use the deprecated TableSchema instead of `Schema.newBuilder().fromFields(names, types).build()`?



##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/TableScanITCase.scala:
##########
@@ -132,23 +128,23 @@ class TableScanITCase extends StreamingTestBase {
     // rows with timestamps and watermarks
     val data = Seq(
       Right(1L),
-      Left(5L, Row.of(new JInt(1), new JLong(5), "A")),
-      Left(2L, Row.of(new JInt(2), new JLong(1), "B")),
+      Left(5L, (1, 5L, "A")),
+      Left(2L, (2, 1L, "B")),
       Right(10L),
-      Left(8L, Row.of(new JInt(6), new JLong(8), "C")),
+      Left(8L, (6, 8L, "C")),
       Right(20L),
-      Left(21L, Row.of(new JInt(6), new JLong(21), "D")),
+      Left(21L, (6, 21L, "D")),
       Right(30L)
     )
 
-    val fieldNames = Array("id", "rtime", "name")
-    val schema = new TableSchema(fieldNames, Array(Types.INT, Types.LOCAL_DATE_TIME, Types.STRING))
-    val rowType = new RowTypeInfo(
-      Array(Types.INT, Types.LONG, Types.STRING).asInstanceOf[Array[TypeInformation[_]]],
-      fieldNames)
+    val t = env
+      .addSource(new EventTimeSourceFunction[(Int, Long, String)](data))

Review Comment:
   Why you still call the deprecated method here?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org