diff --git a/src/languages/snowflake/snowflake.formatter.ts b/src/languages/snowflake/snowflake.formatter.ts index 84f3740b0e..2ec81b1a86 100644 --- a/src/languages/snowflake/snowflake.formatter.ts +++ b/src/languages/snowflake/snowflake.formatter.ts @@ -68,7 +68,7 @@ const tabularOnelineClauses = expandPhrases([ 'DROP ALL ROW ACCESS POLICIES', '{SET | DROP} DEFAULT', // for alter column '{SET | DROP} NOT NULL', // for alter column - '[SET DATA] TYPE', // for alter column + 'SET DATA TYPE', // for alter column 'UNSET COMMENT', // for alter column '{SET | UNSET} MASKING POLICY', // for alter column // - truncate: diff --git a/test/snowflake.test.ts b/test/snowflake.test.ts index 419270ceca..f2d124f944 100644 --- a/test/snowflake.test.ts +++ b/test/snowflake.test.ts @@ -190,4 +190,18 @@ describe('SnowflakeFormatter', () => { third STRING );`); }); + + // Issue #771 + it('allows TYPE to be used as an identifier', () => { + expect(format(`SELECT CASE WHEN type = 'upgrade' THEN amount ELSE 0 END FROM items;`)) + .toBe(dedent` + SELECT + CASE + WHEN type = 'upgrade' THEN amount + ELSE 0 + END + FROM + items; + `); + }); });