wuchong commented on a change in pull request #10693: [FLINK-15334][table sql / 
api] Fix physical schema mapping in TableFormatFactoryBase to support define 
orderless computed column
URL: https://github.com/apache/flink/pull/10693#discussion_r361946074
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/descriptors/SchemaValidatorTest.scala
 ##########
 @@ -168,25 +168,28 @@ class SchemaValidatorTest {
 
   @Test
   def testSchemaWithGeneratedColumnAndWatermark(): Unit = {
-    val descriptor = new Schema()
-      .field("f1", DataTypes.STRING)
-      .field("f2", DataTypes.INT)
-      .field("f3", DataTypes.TIMESTAMP(3))
-
     val properties = new DescriptorProperties()
-    properties.putProperties(descriptor.toProperties)
-    properties.putString("schema.3.name", "generated-column")
-    properties.putString("schema.3.data-type", DataTypes.INT.toString)
-    properties.putString("schema.3.expr", "f2 + 1")
+    properties.putString("schema.0.name", "f1")
+    properties.putString("schema.0.data-type", DataTypes.STRING().toString)
+    properties.putString("schema.1.name", "computed-column")
+    properties.putString("schema.1.data-type", DataTypes.INT().toString)
+    properties.putString("schema.1.expr", "f4 + 1")
+    properties.putString("schema.2.name", "f2")
+    properties.putString("schema.2.data-type", DataTypes.INT().toString)
+    properties.putString("schema.3.name", "f3")
+    properties.putString("schema.3.data-type", DataTypes.TIMESTAMP(3).toString)
+    properties.putString("schema.4.name", "f4")
+    properties.putString("schema.4.data-type", DataTypes.INT().toString)
 
 Review comment:
   Please also add `Rowtime` properties in it to verify the logic of 
`SchemaValidator#deriveTableSinkSchema`. 
   I think `SchemaValidator#deriveTableSinkSchema` still has bug. 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to