<?xml version="1.0" ?>
<Root>
    <TestCase name="testDefault">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT `X` AS `A`, `B` AS `B`, `C` AS `C`, `D`, 'mixed-Case string', `UNQUOTEDCAMELCASEID`, `quoted id`
FROM (SELECT *
        FROM `T`
        WHERE `X` = `Y` AND `A` > 5
        GROUP BY `Z`, `ZZ`
        WINDOW `W` AS (PARTITION BY `C`),
            `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY `GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testCase">
        <Resource name="formatted">
            <![CDATA[CASE
WHEN 1 = 2 + 3
THEN 4
WHEN 1 = CASE
        WHEN `A` = `B`
        THEN `C`
        ELSE `D`
        END
THEN 6
ELSE 7
END]]>
        </Resource>
    </TestCase>
    <TestCase name="testIndent8">
        <Resource name="desc">
            <![CDATA[indentation=8]]>
        </Resource>
        <Resource name="formatted">
            <![CDATA[SELECT `X` AS `A`, `B` AS `B`, `C` AS `C`, `D`, 'mixed-Case string', `UNQUOTEDCAMELCASEID`, `quoted id`
FROM (SELECT *
                FROM `T`
                WHERE `X` = `Y` AND `A` > 5
                GROUP BY `Z`, `ZZ`
                WINDOW `W` AS (PARTITION BY `C`),
                        `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY `GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testClausesNotOnNewLine">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT `X` AS `A`, `B` AS `B`, `C` AS `C`, `D`, 'mixed-Case string', `UNQUOTEDCAMELCASEID`, `quoted id` FROM (SELECT *FROM `T` WHERE `X` = `Y` AND `A` > 5 GROUP BY `Z`, `ZZ` WINDOW `W` AS (PARTITION BY `C`),
            `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY `GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testSelectListItemsOnSeparateLines">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT
    `X` AS `A`,
        `B` AS `B`,
        `C` AS `C`,
    `D`,
    'mixed-Case string',
    `UNQUOTEDCAMELCASEID`,
    `quoted id`
FROM (SELECT
            *
        FROM `T`
        WHERE `X` = `Y` AND `A` > 5
        GROUP BY
            `Z`,
            `ZZ`
        WINDOW `W` AS (PARTITION BY `C`),
            `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY
`GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testSelectListExtraIndentFlag">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT
    `X` AS `A`,
    `B` AS `B`,
    `C` AS `C`,
    `D`,
    'mixed-Case string',
    `UNQUOTEDCAMELCASEID`,
    `quoted id`
FROM (SELECT
            *
        FROM `T`
        WHERE `X` = `Y` AND `A` > 5
        GROUP BY
            `Z`,
            `ZZ`
        WINDOW `W` AS (PARTITION BY `C`),
            `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY
`GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testKeywordsLowerCase">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[select `X` as `A`, `B` as `B`, `C` as `C`, `D`, 'mixed-Case string', `UNQUOTEDCAMELCASEID`, `quoted id`
from (select *
        from `T`
        where `X` = `Y` and `A` > 5
        group by `Z`, `ZZ`
        window `W` as (partition by `C`),
            `W1` as (partition by `C`, `D` order by `A`, `B` range between interval '2:2' hour to minute preceding and interval '1' day following))
order by `GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testParenthesizeAllExprs">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT `X` AS `A`, `B` AS `B`, `C` AS `C`, `D`, 'mixed-Case string', `UNQUOTEDCAMELCASEID`, `quoted id`
FROM (SELECT *
        FROM `T`
        WHERE ((`X` = `Y`) AND (`A` > 5))
        GROUP BY `Z`, `ZZ`
        WINDOW `W` AS (PARTITION BY `C`),
            `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY `GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testOnlyQuoteIdentifiersWhichNeedIt">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT X AS A, B AS B, C AS C, D, 'mixed-Case string', UNQUOTEDCAMELCASEID, `quoted id`
FROM (SELECT *
        FROM T
        WHERE X = Y AND A > 5
        GROUP BY Z, ZZ
        WINDOW W AS (PARTITION BY C),
            W1 AS (PARTITION BY C, D ORDER BY A, B RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY GG]]>
        </Resource>
    </TestCase>
    <TestCase name="testDamiansSubqueryStyle">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT `X` AS `A`, `B` AS `B`, `C` AS `C`, `D`, 'mixed-Case string', `UNQUOTEDCAMELCASEID`, `quoted id`
FROM (    SELECT *
        FROM `T`
        WHERE `X` = `Y` AND `A` > 5
        GROUP BY `Z`, `ZZ`
        WINDOW `W` AS (PARTITION BY `C`),
            `W1` AS (PARTITION BY `C`, `D` ORDER BY `A`, `B` RANGE BETWEEN INTERVAL '2:2' HOUR TO MINUTE PRECEDING AND INTERVAL '1' DAY FOLLOWING))
ORDER BY `GG`]]>
        </Resource>
    </TestCase>
    <TestCase name="testCase2">
        <Resource name="formatted">
            <![CDATA[CASE WHEN 1 = 2 + 3 THEN 4 WHEN 1 = CASE WHEN `A` = `B` THEN `C` ELSE `D` END THEN 6 ELSE 7 END]]>
        </Resource>
    </TestCase>
    <TestCase name="testBetween">
        <Resource name="formatted">
            <![CDATA[`X` NOT BETWEEN SYMMETRIC `Y` AND `Z`]]>
        </Resource>
    </TestCase>
    <TestCase name="testCast">
        <Resource name="formatted">
            <![CDATA[CAST(`X` + `Y` AS DECIMAL(5, 10))]]>
        </Resource>
    </TestCase>
    <TestCase name="testLiteralChain">
        <Resource name="formatted">
            <![CDATA['x'
'y'
'z']]>
        </Resource>
    </TestCase>
    <TestCase name="testOverlaps">
        <Resource name="formatted">
            <![CDATA[(`X`, `XX`) OVERLAPS (`Y`, `YY`) OR `X` IS NOT NULL]]>
        </Resource>
    </TestCase>
    <TestCase name="testUnion">
        <Resource name="formatted">
            <![CDATA[SELECT *
        FROM `T`
    UNION
        SELECT *
        FROM (SELECT *
                        FROM `U`
                    UNION
                        SELECT *
                        FROM `V`)
UNION
    SELECT *
    FROM `W`
ORDER BY `A`, `B`]]>
        </Resource>
    </TestCase>
    <TestCase name="testMultiset">
        <Resource name="formatted">
            <![CDATA[VALUES ROW(MULTISET ((SELECT *
            FROM `T`)))]]>
        </Resource>
    </TestCase>
    <TestCase name="testInnerJoin">
        <Resource name="formatted">
            <![CDATA[SELECT *
FROM `X`
    INNER JOIN `Y` ON `X`.`K` = `Y`.`K`]]>
        </Resource>
    </TestCase>
    <TestCase name="testWhereListItemsOnSeparateLinesOr">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT
    `X`
FROM `Y`
WHERE `H` IS NOT NULL AND `I` < `J`
    OR (`A` OR `B`) IS TRUE AND `D` NOT IN (`F`, `G`)
    OR `X` <> `Z`]]>
        </Resource>
    </TestCase>
    <TestCase name="testWhereListItemsOnSeparateLinesAnd">
        <Resource name="desc"/>
        <Resource name="formatted">
            <![CDATA[SELECT
    `X`
FROM `Y`
WHERE `H` IS NOT NULL
    AND (`I` < `J` OR (`A` OR `B`) IS TRUE)
    AND (`D` NOT IN (`F`, `G`) OR `V` <> (`W` * `X` + `Y`) * `Z`)]]>
        </Resource>
    </TestCase>
</Root>
