snuyanzin commented on PR #22624:
URL: https://github.com/apache/flink/pull/22624#issuecomment-1612073732

   @zhougit86 sorry for the late response
   
   I have a question: could you please clarify it
   it seems your change is inside condition
   ```scala
   if (codeGeneratorCastRule.canFail(inputType, targetType) && nullOnFailure) {
   ...
   val adjustedTargetType = if (nullOnFailure) targetType.copy(nullOnFailure) 
else targetType
             return GeneratedExpression(
               resultTerm,
               nullTerm,
               operand.code + "\n" + castCode,
               adjustedTargetType
             )
   ...
   } else {
   ...
             return GeneratedExpression(
               castCodeBlock.getReturnTerm,
               castCodeBlock.getIsNullTerm,
               operand.code + castCode,
               targetType
             )
   }
   ```
   shouldn't we extract `val adjustedTargetType = if (nullOnFailure) 
targetType.copy(nullOnFailure) else targetType` from `if/else` and apply it to 
both `if` and `else` branches? 


-- 
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-unsubscr...@flink.apache.org

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

Reply via email to