gaoqiangz commented on code in PR #1507:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1507#discussion_r1835445730


##########
src/ast/mod.rs:
##########
@@ -931,6 +931,54 @@ pub enum Expr {
     ///
     /// See 
<https://docs.databricks.com/en/sql/language-manual/sql-ref-lambda-functions.html>.
     Lambda(LambdaFunction),
+    /// MSSQL's `JSON_ARRAY` function for construct JSON-ARRAY object
+    ///
+    /// Syntax:
+    ///
+    /// ```plaintext
+    /// JSON_ARRAY ( [ <json_array_value> [,...n] ] [ <json_null_clause> ]  )  
+    ///
+    /// <json_array_value> ::= value_expression
+    ///
+    /// <json_null_clause> ::=
+    ///       NULL ON NULL
+    ///     | ABSENT ON NULL
+    /// ```
+    ///
+    /// Example:
+    ///
+    /// ```sql
+    /// SELECT JSON_ARRAY('a', 1, 'b', 2) --["a",1,"b",2]
+    /// SELECT JSON_ARRAY('a', 1, NULL, 2 NULL ON NULL) --["a",1,null,2]
+    /// SELECT JSON_ARRAY('a', JSON_OBJECT('name':'value', 'type':1), 
JSON_ARRAY(1, null, 2 NULL ON NULL)) 
--["a",{"name":"value","type":1},[1,null,2]]
+    /// ```
+    ///
+    /// Reference: 
<https://learn.microsoft.com/en-us/sql/t-sql/functions/json-array-transact-sql?view=sql-server-ver16>
+    JsonArray(JsonArray),

Review Comment:
   I'll try it tomorrow.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to