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


##########
src/parser/mod.rs:
##########
@@ -11141,19 +11154,34 @@ impl<'a> Parser<'a> {
     /// FIRST_VALUE(x IGNORE NULL);
     /// ```
     fn parse_function_argument_list(&mut self) -> Result<FunctionArgumentList, 
ParserError> {
+        let mut clauses = vec![];
+
+        if dialect_of!(self is MsSqlDialect) {
+            // JSON_ARRAY(NULL ON NULL)
+            if self.parse_keywords(&[Keyword::NULL, Keyword::ON, 
Keyword::NULL]) {
+                clauses.push(FunctionArgumentClause::JsonNullClause(
+                    JsonNullClause::NullOnNull,
+                ));
+            }
+            // JSON_ARRAY(ABSENT ON NULL)

Review Comment:
   The first few lines of  `parse_keywords` are for 
`JSON_ARRAY(<json-null-clause>)`/``JSON_OBJECT(<json-null-clause>)`` which does 
not have any arguments only includes `json-null-clause` because T-SQL supports 
it.
   
   playground:
   
<https://sqliteonline.com/#sqltext=%23url-sqlite%3Ddb-mssql%0D%0A%23tab-name%3DMS%20SQL%0D%0ASELECT%20JSON_ARRAY(NULL%20ON%20NULL)%2CJSON_OBJECT(ABSENT%20ON%20NULL)>



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