You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/07/17 15:07:46 UTC

[GitHub] [flink] leonardBang commented on a change in pull request #16020: [FLINK-21911][table-api] Add built-in greatest/least functions support #15821

leonardBang commented on a change in pull request #16020:
URL: https://github.com/apache/flink/pull/16020#discussion_r671707964



##########
File path: flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java
##########
@@ -283,6 +283,26 @@
                     .outputTypeStrategy(nullable(explicit(DataTypes.BOOLEAN())))
                     .build();
 
+    public static final BuiltInFunctionDefinition GREATEST =
+            BuiltInFunctionDefinition.newBuilder()
+                    .name("greatest")
+                    .kind(SCALAR)
+                    .inputTypeStrategy(
+                            comparable(ConstantArgumentCount.from(1), StructuredComparision.FULL))
+                    .outputTypeStrategy(nullable(TypeStrategies.COMMON))

Review comment:
       IIUC, ` nullable(TypeStrategy initialStrategy)` has done for this? 
   ```
     /**
        * A type strategy that can be used to make a result type nullable if any of the input arguments
        * is nullable. Otherwise the type will be not null.
        */
       public static TypeStrategy nullable(TypeStrategy initialStrategy) {
           return nullable(ConstantArgumentCount.any(), initialStrategy);
       }
   ```




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

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