wuchong commented on code in PR #19851:
URL: https://github.com/apache/flink/pull/19851#discussion_r897890233


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/utils/ScalarOperatorsTestBase.scala:
##########
@@ -67,8 +67,8 @@ abstract class ScalarOperatorsTestBase extends 
ExpressionTestBase {
       DataTypes.FIELD("f8", DataTypes.INT()),
       DataTypes.FIELD("f9", DataTypes.INT()),
       DataTypes.FIELD("f10", DataTypes.STRING()),
-      DataTypes.FIELD("f11", DataTypes.BOOLEAN()),
-      DataTypes.FIELD("f12", DataTypes.BOOLEAN()),
+      DataTypes.FIELD("f11", DataTypes.BOOLEAN().notNull()),
+      DataTypes.FIELD("f12", DataTypes.BOOLEAN().notNull()),

Review Comment:
   f12 = null, but why declared not null?



##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala:
##########
@@ -351,9 +351,11 @@ object ScalarOperatorGens {
     checkImplicitConversionValidity(left, right)
     val canEqual = isInteroperable(left.resultType, right.resultType)
     if (isCharacterString(left.resultType) && 
isCharacterString(right.resultType)) {
-      generateOperatorIfNotNull(ctx, new BooleanType(), left, right) {
-        (leftTerm, rightTerm) => s"$leftTerm.equals($rightTerm)"
-      }
+      generateOperatorIfNotNull(
+        ctx,
+        new BooleanType(left.resultType.isNullable || 
right.resultType.isNullable),

Review Comment:
   I think it would be more accurate to pass in resultType. Inferring type 
twice is hard to guarantee the type inferring is the same. 



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

Reply via email to