pretty-print CREATE VIEW statements (#1855)

This commit is contained in:
Ophir LOJKINE 2025-05-21 05:44:33 +02:00 committed by GitHub
parent a496f78803
commit 3f4d5f96ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -4858,7 +4858,9 @@ impl fmt::Display for Statement {
if matches!(options, CreateTableOptions::Options(_)) {
write!(f, " {options}")?;
}
write!(f, " AS {query}")?;
f.write_str(" AS")?;
SpaceOrNewline.fmt(f)?;
query.fmt(f)?;
if *with_no_schema_binding {
write!(f, " WITH NO SCHEMA BINDING")?;
}

View file

@ -264,7 +264,6 @@ CREATE TABLE my_table (
}
#[test]
#[ignore = "https://github.com/apache/datafusion-sqlparser-rs/issues/1850"]
fn test_pretty_print_create_view() {
assert_eq!(
prettify("CREATE VIEW my_view AS SELECT a, b FROM my_table WHERE x > 0"),