Skip to content

Commit 2206af2

Browse files
committed
pretty-print CREATE VIEW statements
1 parent ae587dc commit 2206af2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ast/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4858,7 +4858,9 @@ impl fmt::Display for Statement {
48584858
if matches!(options, CreateTableOptions::Options(_)) {
48594859
write!(f, " {options}")?;
48604860
}
4861-
write!(f, " AS {query}")?;
4861+
f.write_str(" AS")?;
4862+
SpaceOrNewline.fmt(f)?;
4863+
query.fmt(f)?;
48624864
if *with_no_schema_binding {
48634865
write!(f, " WITH NO SCHEMA BINDING")?;
48644866
}

tests/pretty_print.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ CREATE TABLE my_table (
265265
}
266266

267267
#[test]
268-
#[ignore = "https://github.com/apache/datafusion-sqlparser-rs/issues/1850"]
269268
fn test_pretty_print_create_view() {
270269
assert_eq!(
271270
prettify("CREATE VIEW my_view AS SELECT a, b FROM my_table WHERE x > 0"),

0 commit comments

Comments
 (0)