etgarperets commented on code in PR #1961:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1961#discussion_r2219392329
##########
tests/sqlparser_common.rs:
##########
@@ -16183,3 +16190,21 @@ fn test_identifier_unicode_start() {
]);
let _ = dialects.verified_stmt(sql);
}
+
+#[test]
+fn parse_create_view_if_not_exists() {
+ let sql = "CREATE VIEW IF NOT EXISTS v AS SELECT 1";
+ let dialects = TestedDialects::new(vec![
+ Box::new(SnowflakeDialect {}),
+ Box::new(GenericDialect {}),
+ Box::new(SQLiteDialect {}),
+ Box::new(BigQueryDialect {}),
+ ]);
+ let _ = dialects.verified_stmt(sql);
+ let sql = "CREATE VIEW v IF NOT EXISTS AS SELECT 1";
Review Comment:
You're right, I couldn't find official documentation for this syntax, though
we have confirmed it works in practice on Snowflake.
I'm happy to remove the dialect flag and update the parser to support both
forms for all dialects. Let me know if you'd like me to proceed with that
change.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]