mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 02:44:11 +00:00
Support CREATE MATERIALIZED VIEW
This commit is contained in:
parent
52e0f55b6f
commit
23a0fc79f5
4 changed files with 26 additions and 5 deletions
|
@ -901,9 +901,23 @@ fn parse_scalar_subqueries() {
|
|||
fn parse_create_view() {
|
||||
let sql = "CREATE VIEW myschema.myview AS SELECT foo FROM bar";
|
||||
match verified_stmt(sql) {
|
||||
SQLStatement::SQLCreateView { name, query } => {
|
||||
SQLStatement::SQLCreateView { name, query, materialized } => {
|
||||
assert_eq!("myschema.myview", name.to_string());
|
||||
assert_eq!("SELECT foo FROM bar", query.to_string());
|
||||
assert!(!materialized);
|
||||
}
|
||||
_ => assert!(false),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_materialized_view() {
|
||||
let sql = "CREATE MATERIALIZED VIEW myschema.myview AS SELECT foo FROM bar";
|
||||
match verified_stmt(sql) {
|
||||
SQLStatement::SQLCreateView { name, query, materialized } => {
|
||||
assert_eq!("myschema.myview", name.to_string());
|
||||
assert_eq!("SELECT foo FROM bar", query.to_string());
|
||||
assert!(materialized);
|
||||
}
|
||||
_ => assert!(false),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue