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/11/12 14:14:46 UTC

[GitHub] [flink] twalthr commented on a change in pull request #17691: [FLINK-24586][table] SQL functions should return STRING instead of VARCHAR(2000)

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



##########
File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/SqlJsonObjectFunction.java
##########
@@ -42,19 +40,21 @@
 import java.util.Locale;
 
 import static org.apache.calcite.util.Static.RESOURCE;
+import static org.apache.flink.table.planner.plan.type.FlinkReturnTypes.VARCHAR_NOT_NULL;
 
 /**
  * This class has been copied from Calcite to backport the fix made during CALCITE-4394.
  *
- * <p>TODO Remove this class with Calcite 1.27 and replace it with {@link
- * SqlStdOperatorTable#JSON_OBJECT}.
+ * <p>TODO Remove this class with Calcite 1.27 and create a wrapper class for the {@link
+ * SqlJsonObjectFunction} but using the {@code VARCHAR_NOT_NULL} return type inference like {@link
+ * SqlJsonArrayFunctionWrapper}.
  */
 public class SqlJsonObjectFunction extends SqlFunction {
     public SqlJsonObjectFunction() {
         super(
                 "JSON_OBJECT",
                 SqlKind.OTHER_FUNCTION,
-                ReturnTypes.VARCHAR_2000,
+                VARCHAR_NOT_NULL,

Review comment:
       introduce a wrapper for this class already. we should not start patching classes copied from Calcite.




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