Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createTableColumnAlignment
When
true, formatsCREATE TABLEcolumn definitions in a three-columnaligned layout:
col_name), left-aligned.column_definition),e.g.
INT,VARCHAR(100),DECIMAL(10, 2), left-aligned.PRIMARY KEY,NOT NULL,DEFAULT,COMMENT,UNIQUE, ...), left-aligned.The width of each column is sized to the widest entry in that column across
all column definitions in the same
CREATE TABLEstatement, so the startsof columns 2 and 3 line up vertically across rows.
Table-level constraints (
CONSTRAINT name UNIQUE (...),PRIMARY KEY (...),FOREIGN KEY (...),CHECK (...), ...) do not havethe
col_name / column_definition / othershape, so they are emitted ontheir own line without padding.
Defaults to
false(preserves the legacy single-space layout).Options
true– enable three-column alignment forCREATE TABLEcolumn lists.false(default) – use the legacy single-space layout.Example
false (default)
true
Scope and limitations
follows a
CREATE TABLEclause keyword (e.g.CREATE TABLE,CREATE OR REPLACE TABLE,CREATE TEMP TABLE,CREATE TABLE IF NOT EXISTS,CREATE EXTERNAL TABLE, ...). It does not apply to nested parenthesessuch as the size list of
VARCHAR(100)or the column list of aCHECK (...)constraint.CREATE TABLEwhose column list fits on a single line (underexpressionWidth) stays on a single line — thealignment only kicks in when the column list is split across multiple
lines.
example because it contains a multi-line comment, or because the
"other" part contains a sub-clause like
ON UPDATEin dialects thatreserve
UPDATEas a clause keyword), the wholeCREATE TABLEcolumn list falls back to the legacy multi-line layout for that
statement.
createTableColumnAlignment_breakwidth
Maximum character width of the third column (constraints, comments,
defaults, ...) in a
CREATE TABLEcolumn definition. When the thirdcolumn's content exceeds this width, it is wrapped onto a new continuation
line indented to align with the start of the third column.
Only takes effect when
createTableColumnAlignmentis
true. Ignored otherwise.Options
30) — wrap the "other" part to a new line whenits length exceeds this many characters.
0— always wrap the "other" part to a new line, even when it's short.Infinity(default) — never wrap; the "other" part is always kept on thesame line as the column name and data type, regardless of length.
Example
Given the following input:
createTableColumnAlignment_breakwidth: Infinity(default)createTableColumnAlignment_breakwidth: 30The long "other" part of column
ais wrapped to a continuation lineindented to align with the start of the third column:
createTableColumnAlignment_breakwidth: 0Every non-empty "other" part is wrapped to a continuation line: