Skip to content

Failed formatting with CTE and CASE statement #395

Closed
@AndrewLaneAtPowerSchool

Description

Describe the bug
Formatting failure on code that I think should succeed

To Reproduce
Try to format:

CREATE OR REPLACE VIEW someview AS
WITH some_cte AS (
    SELECT
        CASE
            WHEN foo = bar THEN 1
            ELSE 0
        END AS biz
    FROM
    BAT
)
select * from some_cte

Expected behavior
Expecting formatting to succeed without an error.

Actual behavior

sqlfmt encountered an error: Closing bracket ')' found at 167 does not match last opened bracket 'CASE' found at 65.

Additional context
What is the output of sqlfmt --version?
0.14.2 but I was able to reproduce it on the https://sqlfmt.com/ sandbox as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DDL-DMLbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions