Airblader commented on a change in pull request #17481:
URL: https://github.com/apache/flink/pull/17481#discussion_r728913694



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java
##########
@@ -1145,6 +1145,16 @@ public boolean isDeterministic() {
     public static final SqlFunction JSON_EXISTS = 
SqlStdOperatorTable.JSON_EXISTS;
     public static final SqlFunction JSON_VALUE = 
SqlStdOperatorTable.JSON_VALUE;
     public static final SqlFunction JSON_QUERY = 
SqlStdOperatorTable.JSON_QUERY;
+    public static final SqlFunction JSON_STRING =
+            new SqlFunction(
+                    "JSON_STRING",
+                    SqlKind.OTHER_FUNCTION,
+                    ReturnTypes.cascade(
+                            ReturnTypes.explicit(SqlTypeName.VARCHAR),
+                            FlinkReturnTypes.TO_NULLABLE_SHALLOW),

Review comment:
       Calcite's `TO_NULLABLE` actually has a (to me) surprising behavior that 
breaks tests: for structured types – like `ROW` – it also checks the 
nullability of all of the inner fields. This means that `ROW<r0 STRING> NOT 
NULL` would be considered nullable. Big "wat?" moment to me, and curious to 
have someone explain to me why that makes sense.




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