snuyanzin commented on code in PR #28850:
URL: https://github.com/apache/flink/pull/28850#discussion_r3728160194


##########
docs/data/sql_functions.yml:
##########
@@ -1267,6 +1267,50 @@ json:
       
         -- JSON_EXISTS separates an absent path from a present one
         SELECT JSON_EXISTS(json_doc, '$.items[*]'), JSON_LENGTH(json_doc, 
'$.items[*]');
+  - sql: JSON_TYPE(jsonValue[, path])
+    table: jsonType(jsonValue[, path])
+    description: |
+      Returns a string value indicating the type of jsonValue, optionally at 
the given JSON
+      `path`. Returns `NULL` if jsonValue is `NULL`, is not valid JSON, or the 
path does not
+      resolve to exactly one value.
+
+      The possible results are `OBJECT`, `ARRAY`, `STRING`, `NUMBER` and 
`BOOLEAN`, plus the string
+      `'NULL'` for the JSON null literal. These are the types of JSON's own 
grammar.
+
+      JSON has a single number rule with no width, so every number is reported 
as `NUMBER`.
+      Anything quoted is a `STRING`, including dates and date-times.
+
+      ```sql
+      -- OBJECT
+      SELECT JSON_TYPE('{"a": true}')
+
+      -- ARRAY
+      SELECT JSON_TYPE('[1, 2]')
+
+      -- the JSON null literal, returned as the string 'NULL'
+      SELECT JSON_TYPE('null')
+
+      -- BOOLEAN
+      SELECT JSON_TYPE('true')
+
+      -- STRING
+      SELECT JSON_TYPE('"Hello, World!"')
+
+      -- STRING, since a date in JSON is just a quoted string
+      SELECT JSON_TYPE('"2015-01-01"')
+

Review Comment:
   is comment still valid?
   is there a chance `JSON_TYPE` for a similar json returns not a `STRING`?



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