JinkunLiu commented on code in PR #27492:
URL: https://github.com/apache/flink/pull/27492#discussion_r2759837946


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/JsonGenerateUtils.scala:
##########
@@ -119,6 +119,12 @@ object JsonGenerateUtils {
       case DISTINCT_TYPE =>
         createNodeTerm(ctx, valueTerm, 
valueType.asInstanceOf[DistinctType].getSourceType)
 
+      case VARIANT =>
+        s"""
+           |$nodeFactoryTerm.rawValueNode(
+           |    new ${typeTerm(classOf[RawValue])}($valueTerm.toJson()))
+           |""".stripMargin

Review Comment:
   Nit: Could this be written on a single line? That would be more consistent 
with coding style.
   
   ```java
   s"$nodeFactoryTerm.rawValueNode(new 
${typeTerm(classOf[RawValue])}($valueTerm.toJson()))"
   ```



##########
docs/data/sql_functions.yml:
##########
@@ -1176,7 +1181,7 @@ variant:
     table: VARIANT.at(STRING)
     description: |
       If the VARIANT is a MAP value that has an element with this key, a 
VARIANT holding
-      the associated value is returned. Otherwise, NULL is returned.
+      the associated value is returned. Otherwise, NULL is returned. 

Review Comment:
   It looks like there's an extra space here.



##########
docs/data/sql_functions.yml:
##########
@@ -942,6 +942,8 @@ json:
       JSON_STRING('Hello, World!')
       -- '[1,2]'
       JSON_STRING(ARRAY[1, 2])
+      -- '{"k1":"v1"}'
+      JSON_STRING(PARSE_JSON('{"k1":"v1"}'))

Review Comment:
   If possible, could you add the same English documentation as a placeholder 
at line 1253 in sql_functions_zh.yml



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