slinkydeveloper commented on a change in pull request #19045:
URL: https://github.com/apache/flink/pull/19045#discussion_r824478394



##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala
##########
@@ -477,40 +477,26 @@ object CodeGenUtils {
         case Some(writer) =>
           // use writer to set field
           val writeField = binaryWriterWriteField(ctx, indexTerm, fieldTerm, 
writer, fieldType)
-          if (ctx.nullCheck) {
-            s"""
-               |${fieldExpr.code}
-               |if (${fieldExpr.nullTerm}) {
-               |  ${binaryWriterWriteNull(indexTerm, writer, fieldType)};
-               |} else {
-               |  $writeField;
-               |}
-             """.stripMargin
-          } else {
-            s"""
-               |${fieldExpr.code}
-               |$writeField;
-             """.stripMargin
-          }
+          s"""

Review comment:
       Now in theory, at every location where you're removing the 
`ctx.nullCheck`, you should check if the type of the `fieldExpr` is nullable or 
not.
   
   Problem is that a lot of code doesn't care about nullability... Maybe do you 
wanna give it a try and see if it works?

##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/ExprCodeGenerator.scala
##########
@@ -215,7 +209,7 @@ class ExprCodeGenerator(ctx: CodeGeneratorContext, 
nullableInput: Boolean)
           input2Term.get,
           idx,
           nullableInput,
-          ctx.nullCheck)
+          true)

Review comment:
       This function doesn't need this boolean anymore?




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