twalthr commented on a change in pull request #17256:
URL: https://github.com/apache/flink/pull/17256#discussion_r708448017



##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/calcite/FlinkPlannerImpl.scala
##########
@@ -97,6 +97,7 @@ class FlinkPlannerImpl(
       typeFactory,
       SqlValidator.Config.DEFAULT
         .withIdentifierExpansion(true)
+        .withCallRewrite(false) // Disables the rewrite of COALESCE

Review comment:
       the disabling of all rewrite would have been problematic, having 
different plans for the COALESCE calls sounds ok to me. fyi: you can simply 
delete the affected xml file and rerun the entire test class, this will 
regenerate the file.

##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/TypeStrategies.java
##########
@@ -105,6 +105,23 @@ public static TypeStrategy nullableIfArgs(TypeStrategy 
initialStrategy) {
         return nullableIfArgs(ConstantArgumentCount.any(), initialStrategy);
     }
 
+    /**
+     * A type strategy that can be used to make a result type nullable if all 
the selected input
+     * arguments is nullable. Otherwise the type will be not null.
+     */
+    public static TypeStrategy nullableIfAllArgs(

Review comment:
       given that the `COMMON_ARG` input strategy is executed first, can't we 
just derive the nullability from the first arg?




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