mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Add all missing table options to be handled in any order (#1747)
Co-authored-by: Tomer Shani <tomer.shani@satoricyber.com>
This commit is contained in:
parent
a464f8e8d7
commit
728645fb31
17 changed files with 767 additions and 382 deletions
|
@ -470,9 +470,22 @@ fn test_snowflake_create_table_cluster_by() {
|
|||
#[test]
|
||||
fn test_snowflake_create_table_comment() {
|
||||
match snowflake().verified_stmt("CREATE TABLE my_table (a INT) COMMENT = 'some comment'") {
|
||||
Statement::CreateTable(CreateTable { name, comment, .. }) => {
|
||||
Statement::CreateTable(CreateTable {
|
||||
name,
|
||||
table_options,
|
||||
..
|
||||
}) => {
|
||||
assert_eq!("my_table", name.to_string());
|
||||
assert_eq!("some comment", comment.unwrap().to_string());
|
||||
let plain_options = match table_options {
|
||||
CreateTableOptions::Plain(options) => options,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let comment = match plain_options.first().unwrap() {
|
||||
SqlOption::Comment(CommentDef::WithEq(c))
|
||||
| SqlOption::Comment(CommentDef::WithoutEq(c)) => c,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
assert_eq!("some comment", comment);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue