liuyongvs commented on code in PR #15797:
URL: https://github.com/apache/flink/pull/15797#discussion_r1118638715


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/SpecificInputTypeStrategies.java:
##########
@@ -120,6 +124,41 @@ public final class SpecificInputTypeStrategies {
     public static final InputTypeStrategy TWO_EQUALS_COMPARABLE =
             comparable(ConstantArgumentCount.of(2), 
StructuredType.StructuredComparison.EQUALS);
 
+    /** Type strategy specific for {@link 
BuiltInFunctionDefinitions#MAP_KEYS}. */
+    public static final TypeStrategy MAP_KEYS =
+            callContext ->
+                    Optional.of(
+                            DataTypes.ARRAY(
+                                            callContext
+                                                    .getArgumentDataTypes()
+                                                    .get(0)
+                                                    .getChildren()
+                                                    .get(0))
+                                    .nullable());
+

Review Comment:
   1. should use cast  KeyValueDataType and it will throw exception eagerly
    Optional.of(
                                                               DataTypes.ARRAY(
                                                                       
((KeyValueDataType) mapType)
                                                                               
.getKeyDataType()))
   
   2. why force nullable, it may not be right



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