godfreyhe commented on a change in pull request #14451:
URL: https://github.com/apache/flink/pull/14451#discussion_r548361542



##########
File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/calcite/FlinkTypeFactoryTest.scala
##########
@@ -91,4 +94,16 @@ class FlinkTypeFactoryTest {
     Assert.assertEquals(new DecimalType(38, 5), 
FlinkTypeSystem.inferAggSumType(5))
     Assert.assertEquals(new DecimalType(false, 38, 6), 
FlinkTypeSystem.inferAggAvgType(5))
   }
+
+  @Test
+  def testCanonizeType(): Unit = {
+    val typeFactory = FlinkTypeFactory.INSTANCE
+    val genericTypeInfo = Types.GENERIC(classOf[TestClass])
+    val genericRelType = typeFactory.createFieldTypeFromLogicalType(new 
TypeInformationRawType(genericTypeInfo))
+    val genericRelType2 = typeFactory.createFieldTypeFromLogicalType(new 
TypeInformationRawType(genericTypeInfo))
+
+    assertTrue("The type expect to be canonized", genericRelType == 
genericRelType2)

Review comment:
       should use `eq` instead of `==` for object equivalence in Scala




----------------------------------------------------------------
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


Reply via email to