JingGe commented on code in PR #24156:
URL: https://github.com/apache/flink/pull/24156#discussion_r1471255451


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/ScalarFunctionsTest.scala:
##########
@@ -604,6 +604,20 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
       "foothebar")
   }
 
+  @Test
+  def testJsonQuote(): Unit = {
+    testSqlApi("JSON_QUOTE('null')", "\"null\"")
+    testSqlApi("JSON_QUOTE('\"null\"')", "\"\\\"null\\\"\"")
+    testSqlApi("JSON_QUOTE('[1, 2, 3]')", "\"[1, 2, 3]\"")

Review Comment:
   does it make sense to cover all Special Character Escape Sequences?



##########
flink-python/pyflink/table/expression.py:
##########
@@ -88,7 +88,8 @@
              :func:`~Expression.overlay`, :func:`~Expression.regexp_replace`,
              :func:`~Expression.regexp_extract`, :func:`~Expression.substring`,
              :py:attr:`~Expression.from_base64`, 
:py:attr:`~Expression.to_base64`,
-             :py:attr:`~Expression.ltrim`, :py:attr:`~Expression.rtrim`, 
:func:`~Expression.repeat`
+             :py:attr:`~Expression.ltrim`, :py:attr:`~Expression.rtrim`, 
:func:`~Expression.repeat`,
+             :py:attr:`~Expression.json_quote`, 
:py:attr:`~Expression.json_unquote`

Review Comment:
   :func: instead of :py:attr: 



##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java:
##########
@@ -716,6 +716,28 @@ public SqlSyntax getSyntax() {
                                     SqlTypeFamily.BOOLEAN, SqlTypeFamily.TIME, 
SqlTypeFamily.TIME)),
                     SqlFunctionCategory.NUMERIC);
 
+    public static final SqlFunction JSON_QUOTE =
+            new SqlFunction(

Review Comment:
   I am not really sure if `BuiltInSqlFunction` should used or not.



##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/sql/FlinkSqlOperatorTable.java:
##########
@@ -716,6 +716,28 @@ public SqlSyntax getSyntax() {
                                     SqlTypeFamily.BOOLEAN, SqlTypeFamily.TIME, 
SqlTypeFamily.TIME)),
                     SqlFunctionCategory.NUMERIC);
 
+    public static final SqlFunction JSON_QUOTE =

Review Comment:
   should it also be built in `BuiltInFunctionDefinitions` ?



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