File tree Expand file tree Collapse file tree
testdata/ddl/format/beautify Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -840,30 +840,30 @@ func (c *CreateLiveView) FormatSQL(formatter *Formatter) {
840840 formatter .WriteExpr (c .Name )
841841
842842 if c .OnCluster != nil {
843- formatter .WriteByte ( whitespace )
843+ formatter .Break ( )
844844 formatter .WriteExpr (c .OnCluster )
845845 }
846846
847847 if c .WithTimeout != nil {
848- formatter .WriteByte ( whitespace )
848+ formatter .Break ( )
849849 formatter .WriteExpr (c .WithTimeout )
850850 }
851851
852852 if c .Destination != nil {
853- formatter .WriteByte ( whitespace )
853+ formatter .Break ( )
854854 formatter .WriteExpr (c .Destination )
855855 }
856856
857857 if c .TableSchema != nil {
858- formatter .WriteByte ( whitespace )
858+ formatter .Break ( )
859859 formatter .WriteExpr (c .TableSchema )
860860 }
861861
862862 if c .SubQuery != nil {
863- formatter .WriteString (" AS " )
863+ formatter .Break ()
864+ formatter .WriteString ("AS " )
864865 formatter .WriteExpr (c .SubQuery )
865866 }
866-
867867}
868868
869869func (c * CreateMaterializedView ) FormatSQL (formatter * Formatter ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,13 @@ AS SELECT id FROM my_table;
55
66
77-- Beautify SQL:
8- CREATE LIVE VIEW my_live_view WITH TIMEOUT 10 TO my_destination (
8+ CREATE LIVE VIEW my_live_view
9+ WITH TIMEOUT 10
10+ TO my_destination
11+ (
912 id String
10- ) AS SELECT
13+ )
14+ AS SELECT
1115 id
1216FROM
1317 my_table;
You can’t perform that action at this time.
0 commit comments