Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,7 @@ class SqlFormatPreProcessor : PreFormatProcessor {
}

SqlTypes.LEFT_PAREN -> {
newKeyword =
if (createQueryType == CreateQueryType.TABLE) {
getNewLineString(it.prevSibling, getUpperText(it))
} else if (keywordIndex > 0) {
if (listOf(
"insert",
"into",
"all",
).contains(replaceKeywordList[keywordIndex - 1].text.lowercase())
) {
getNewLineString(it.prevSibling, getUpperText(it))
} else {
getUpperText(it)
}
} else {
getUpperText(it)
}
newKeyword = getNewLineString(it.prevSibling, getUpperText(it))
}

SqlTypes.RIGHT_PAREN -> {
Expand Down
4 changes: 2 additions & 2 deletions src/test/testData/sql/formatter/WithUnionAll.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
with tables AS ( ( SELECT top, no_pre_as AS AS_NAME, pre_as, clm3 from demo
with tables AS (( SELECT top, no_pre_as AS AS_NAME, pre_as, clm3 from demo
WHERE id = /*# "block" */ )
UNION ALL ( SELECT id2, no_pre_as2 AS AS_NAME2, pre_as2 FROM demo2
WHERE id2 = /*# "block2" */ ) )
WHERE id2 = /*# "block2" */ ))
SELECT query.id3
, query.no_pre_as3 AS AS_NAME3
, query.pre_as3
Expand Down
Loading