iffyio commented on code in PR #1538:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1538#discussion_r1895651779


##########
src/parser/mod.rs:
##########
@@ -3869,11 +3873,16 @@ impl<'a> Parser<'a> {
             .is_some();
         let persistent = dialect_of!(self is DuckDbDialect)
             && self.parse_one_of_keywords(&[Keyword::PERSISTENT]).is_some();
+        let create_view_params = if dialect_of!(self is MySqlDialect | 
GenericDialect) {
+            self.parse_create_view_params()?
+        } else {
+            None
+        };

Review Comment:
   maybe this could be accepted without the dialect check if that works just as 
well `let create_view_paras = self.parse_create_view_params()`?  thinking since 
the view params are optional



##########
src/parser/mod.rs:
##########
@@ -11375,7 +11466,11 @@ impl<'a> Parser<'a> {
         } else {
             let object_type =
                 self.parse_one_of_keywords(&[Keyword::SEQUENCE, 
Keyword::SCHEMA, Keyword::TABLE]);
-            let objects = self.parse_comma_separated(|p| 
p.parse_object_name(false));
+            let objects = if dialect_of!(self is MySqlDialect | 
GenericDialect) {
+                self.parse_comma_separated(|p| 
p.parse_object_name_with_wildcards(false, true))
+            } else {
+                self.parse_comma_separated(|p| p.parse_object_name(false))
+            };

Review Comment:
   Thinking similarly here, if there aren't any conflicting behavior we could 
skip the dialect check and always parse the object name with wildcard?



##########
src/parser/mod.rs:
##########
@@ -8353,20 +8409,40 @@ impl<'a> Parser<'a> {
         }
     }
 
+    /// Parse a possibly qualified, possibly quoted identifier, optionally 
allowing for wildcards,
+    /// e.g. *, `foo`.*, or "foo"."bar"
+    pub fn parse_object_name_with_wildcards(

Review Comment:
   Ah not a problem I think this sounds reasonable! Could we maybe make the 
function non-public in case it needs to change later on so that we don't 
consider downstream impact?



##########
src/parser/mod.rs:
##########
@@ -4842,9 +4852,68 @@ impl<'a> Parser<'a> {
             if_not_exists,
             temporary,
             to,
+            params: create_view_params,
         })
     }
 
+    /// Parse optional algorithm, definer, and security context parameters for 
[MySQL]

Review Comment:
   ```suggestion
       /// Parse optional parameters for the `CREATE VIEW` statement. [MySQL]
   ```
   or something similar, thinking so since this can be extended later beyond 
mysql today



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