---------- Input ----------
show databases
---------- Output ---------
SHOW DATABASES
---------- AST ------------
ShowDatabases(
    ShowDatabasesStmt {
        catalog: None,
        full: false,
        limit: None,
    },
)


---------- Input ----------
show drop databases
---------- Output ---------
SHOW DROP DATABASES
---------- AST ------------
ShowDropDatabases(
    ShowDropDatabasesStmt {
        catalog: None,
        limit: None,
    },
)


---------- Input ----------
SET SECONDARY ROLES ALL
---------- Output ---------
SET SECONDARY ROLES ALL
---------- AST ------------
SetSecondaryRoles {
    option: All,
}


---------- Input ----------
SET SECONDARY ROLES NONE
---------- Output ---------
SET SECONDARY ROLES NONE
---------- AST ------------
SetSecondaryRoles {
    option: None,
}


---------- Input ----------
SET SECONDARY ROLES role1, role2
---------- Output ---------
SET SECONDARY ROLES role1, role2
---------- AST ------------
SetSecondaryRoles {
    option: SpecifyRole(
        [
            "role1",
            "role2",
        ],
    ),
}


---------- Input ----------
show drop databases like 'db%'
---------- Output ---------
SHOW DROP DATABASES LIKE 'db%'
---------- AST ------------
ShowDropDatabases(
    ShowDropDatabasesStmt {
        catalog: None,
        limit: Some(
            Like {
                pattern: "db%",
            },
        ),
    },
)


---------- Input ----------
show databases format TabSeparatedWithNamesAndTypes;
---------- Output ---------
SHOW DATABASES
---------- AST ------------
ShowDatabases(
    ShowDatabasesStmt {
        catalog: None,
        full: false,
        limit: None,
    },
)


---------- FORMAT ------------
Some(
    "TabSeparatedWithNamesAndTypes",
)
---------- Input ----------
show tables
---------- Output ---------
SHOW TABLES
---------- AST ------------
ShowTables(
    ShowTablesStmt {
        catalog: None,
        database: None,
        full: false,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show stages like '%a'
---------- Output ---------
SHOW STAGES LIKE '%a'
---------- AST ------------
ShowStages {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "%a",
                },
            ),
            limit: None,
        },
    ),
}


---------- Input ----------
show users where name='root'
---------- Output ---------
SHOW USERS WHERE name = 'root'
---------- AST ------------
ShowUsers {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            21..22,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                17..21,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            17..21,
                                        ),
                                        name: "name",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                22..28,
                            ),
                            value: String(
                                "root",
                            ),
                        },
                    },
                },
            ),
            limit: None,
        },
    ),
}


---------- Input ----------
show roles where name='public'
---------- Output ---------
SHOW ROLES WHERE name = 'public'
---------- AST ------------
ShowRoles {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            21..22,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                17..21,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            17..21,
                                        ),
                                        name: "name",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                22..30,
                            ),
                            value: String(
                                "public",
                            ),
                        },
                    },
                },
            ),
            limit: None,
        },
    ),
}


---------- Input ----------
show drop tables
---------- Output ---------
SHOW DROP TABLES
---------- AST ------------
ShowDropTables(
    ShowDropTablesStmt {
        database: None,
        limit: None,
    },
)


---------- Input ----------
show drop tables like 't%'
---------- Output ---------
SHOW DROP TABLES LIKE 't%'
---------- AST ------------
ShowDropTables(
    ShowDropTablesStmt {
        database: None,
        limit: Some(
            Like {
                pattern: "t%",
            },
        ),
    },
)


---------- Input ----------
show drop tables where name='t'
---------- Output ---------
SHOW DROP TABLES WHERE name = 't'
---------- AST ------------
ShowDropTables(
    ShowDropTablesStmt {
        database: None,
        limit: Some(
            Where {
                selection: BinaryOp {
                    span: Some(
                        27..28,
                    ),
                    op: Eq,
                    left: ColumnRef {
                        span: Some(
                            23..27,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        23..27,
                                    ),
                                    name: "name",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            28..31,
                        ),
                        value: String(
                            "t",
                        ),
                    },
                },
            },
        ),
    },
)


---------- Input ----------
show tables format TabSeparatedWithNamesAndTypes;
---------- Output ---------
SHOW TABLES
---------- AST ------------
ShowTables(
    ShowTablesStmt {
        catalog: None,
        database: None,
        full: false,
        limit: None,
        with_history: false,
    },
)


---------- FORMAT ------------
Some(
    "TabSeparatedWithNamesAndTypes",
)
---------- Input ----------
describe "name""with""quote";
---------- Output ---------
DESCRIBE "name""with""quote"
---------- AST ------------
DescribeTable(
    DescribeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                9..28,
            ),
            name: "name\"with\"quote",
            quote: Some(
                '"',
            ),
            ident_type: None,
        },
    },
)


---------- Input ----------
describe "name""""with""""quote";
---------- Output ---------
DESCRIBE "name""""with""""quote"
---------- AST ------------
DescribeTable(
    DescribeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                9..32,
            ),
            name: "name\"\"with\"\"quote",
            quote: Some(
                '"',
            ),
            ident_type: None,
        },
    },
)


---------- Input ----------
show full tables
---------- Output ---------
SHOW FULL TABLES
---------- AST ------------
ShowTables(
    ShowTablesStmt {
        catalog: None,
        database: None,
        full: true,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show full tables from db
---------- Output ---------
SHOW FULL TABLES FROM db
---------- AST ------------
ShowTables(
    ShowTablesStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    22..24,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        full: true,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show full tables from ctl.db
---------- Output ---------
SHOW FULL TABLES FROM ctl.db
---------- AST ------------
ShowTables(
    ShowTablesStmt {
        catalog: Some(
            Identifier {
                span: Some(
                    22..25,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Some(
            Identifier {
                span: Some(
                    26..28,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        full: true,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show full columns in t in db
---------- Output ---------
SHOW FULL COLUMNS FROM t FROM db
---------- AST ------------
ShowColumns(
    ShowColumnsStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    26..28,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                21..22,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        full: true,
        limit: None,
    },
)


---------- Input ----------
show columns in t from ctl.db
---------- Output ---------
SHOW COLUMNS FROM t FROM ctl.db
---------- AST ------------
ShowColumns(
    ShowColumnsStmt {
        catalog: Some(
            Identifier {
                span: Some(
                    23..26,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Some(
            Identifier {
                span: Some(
                    27..29,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                16..17,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        full: false,
        limit: None,
    },
)


---------- Input ----------
show columns from ctl.db.t
---------- Output ---------
SHOW COLUMNS FROM t FROM ctl.db
---------- AST ------------
ShowColumns(
    ShowColumnsStmt {
        catalog: Some(
            Identifier {
                span: Some(
                    18..21,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Some(
            Identifier {
                span: Some(
                    22..24,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                25..26,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        full: false,
        limit: None,
    },
)


---------- Input ----------
show full columns from t from db like 'id%'
---------- Output ---------
SHOW FULL COLUMNS FROM t FROM db LIKE 'id%'
---------- AST ------------
ShowColumns(
    ShowColumnsStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    30..32,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                23..24,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        full: true,
        limit: Some(
            Like {
                pattern: "id%",
            },
        ),
    },
)


---------- Input ----------
show full columns from db.t like 'id%'
---------- Output ---------
SHOW FULL COLUMNS FROM t FROM db LIKE 'id%'
---------- AST ------------
ShowColumns(
    ShowColumnsStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    23..25,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                26..27,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        full: true,
        limit: Some(
            Like {
                pattern: "id%",
            },
        ),
    },
)


---------- Input ----------
show processlist like 't%' limit 2;
---------- Output ---------
SHOW PROCESSLIST LIKE 't%' LIMIT 2
---------- AST ------------
ShowProcessList {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "t%",
                },
            ),
            limit: Some(
                2,
            ),
        },
    ),
}


---------- Input ----------
show processlist where database='default' limit 2;
---------- Output ---------
SHOW PROCESSLIST WHERE database = 'default' LIMIT 2
---------- AST ------------
ShowProcessList {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            31..32,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                23..31,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            23..31,
                                        ),
                                        name: "database",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                32..41,
                            ),
                            value: String(
                                "default",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                2,
            ),
        },
    ),
}


---------- Input ----------
show create table a.b;
---------- Output ---------
SHOW CREATE TABLE a.b
---------- AST ------------
ShowCreateTable(
    ShowCreateTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    18..19,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                20..21,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        with_quoted_ident: false,
    },
)


---------- Input ----------
show create table a.b with quoted_identifiers;
---------- Output ---------
SHOW CREATE TABLE a.b WITH QUOTED_IDENTIFIERS
---------- AST ------------
ShowCreateTable(
    ShowCreateTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    18..19,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                20..21,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        with_quoted_ident: true,
    },
)


---------- Input ----------
show create table a.b format TabSeparatedWithNamesAndTypes;
---------- Output ---------
SHOW CREATE TABLE a.b
---------- AST ------------
ShowCreateTable(
    ShowCreateTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    18..19,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                20..21,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        with_quoted_ident: false,
    },
)


---------- FORMAT ------------
Some(
    "TabSeparatedWithNamesAndTypes",
)
---------- Input ----------
replace into test on(c) select sum(c) as c from source group by v;
---------- Output ---------
REPLACE INTO test ON (c) SELECT sum(c) AS c FROM source GROUP BY v
---------- AST ------------
Replace(
    ReplaceStmt {
        hints: None,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..17,
            ),
            name: "test",
            quote: None,
            ident_type: None,
        },
        is_conflict: false,
        on_conflict_columns: [
            Identifier {
                span: Some(
                    21..22,
                ),
                name: "c",
                quote: None,
                ident_type: None,
            },
        ],
        columns: [],
        source: Select {
            query: Query {
                span: Some(
                    24..65,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            24..65,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            AliasedExpr {
                                expr: FunctionCall {
                                    span: Some(
                                        31..37,
                                    ),
                                    func: FunctionCall {
                                        distinct: false,
                                        name: Identifier {
                                            span: Some(
                                                31..34,
                                            ),
                                            name: "sum",
                                            quote: None,
                                            ident_type: None,
                                        },
                                        args: [
                                            ColumnRef {
                                                span: Some(
                                                    35..36,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                35..36,
                                                            ),
                                                            name: "c",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                        ],
                                        params: [],
                                        order_by: [],
                                        window: None,
                                        lambda: None,
                                    },
                                },
                                alias: Some(
                                    Identifier {
                                        span: Some(
                                            41..42,
                                        ),
                                        name: "c",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        ],
                        from: [
                            Table {
                                span: Some(
                                    48..54,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        48..54,
                                    ),
                                    name: "source",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        ],
                        selection: None,
                        group_by: Some(
                            Normal(
                                [
                                    ColumnRef {
                                        span: Some(
                                            64..65,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        64..65,
                                                    ),
                                                    name: "v",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                            ),
                        ),
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [],
                offset: None,
                ignore_result: false,
            },
        },
        delete_when: None,
    },
)


---------- Input ----------
explain pipeline select a from b;
---------- Output ---------
EXPLAIN PIPELINE SELECT a FROM b
---------- AST ------------
Explain {
    kind: Pipeline,
    options: (
        None,
        [],
    ),
    query: Query(
        Query {
            span: Some(
                17..32,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        17..32,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    24..25,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                24..25,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                31..32,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    31..32,
                                ),
                                name: "b",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    ),
}


---------- Input ----------
explain replace into test on(c) select sum(c) as c from source group by v;
---------- Output ---------
EXPLAIN REPLACE INTO test ON (c) SELECT sum(c) AS c FROM source GROUP BY v
---------- AST ------------
Explain {
    kind: Plan,
    options: (
        None,
        [],
    ),
    query: Replace(
        ReplaceStmt {
            hints: None,
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    21..25,
                ),
                name: "test",
                quote: None,
                ident_type: None,
            },
            is_conflict: false,
            on_conflict_columns: [
                Identifier {
                    span: Some(
                        29..30,
                    ),
                    name: "c",
                    quote: None,
                    ident_type: None,
                },
            ],
            columns: [],
            source: Select {
                query: Query {
                    span: Some(
                        32..73,
                    ),
                    with: None,
                    body: Select(
                        SelectStmt {
                            span: Some(
                                32..73,
                            ),
                            hints: None,
                            distinct: false,
                            top_n: None,
                            select_list: [
                                AliasedExpr {
                                    expr: FunctionCall {
                                        span: Some(
                                            39..45,
                                        ),
                                        func: FunctionCall {
                                            distinct: false,
                                            name: Identifier {
                                                span: Some(
                                                    39..42,
                                                ),
                                                name: "sum",
                                                quote: None,
                                                ident_type: None,
                                            },
                                            args: [
                                                ColumnRef {
                                                    span: Some(
                                                        43..44,
                                                    ),
                                                    column: ColumnRef {
                                                        database: None,
                                                        table: None,
                                                        column: Name(
                                                            Identifier {
                                                                span: Some(
                                                                    43..44,
                                                                ),
                                                                name: "c",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                    },
                                                },
                                            ],
                                            params: [],
                                            order_by: [],
                                            window: None,
                                            lambda: None,
                                        },
                                    },
                                    alias: Some(
                                        Identifier {
                                            span: Some(
                                                49..50,
                                            ),
                                            name: "c",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            ],
                            from: [
                                Table {
                                    span: Some(
                                        56..62,
                                    ),
                                    catalog: None,
                                    database: None,
                                    table: Identifier {
                                        span: Some(
                                            56..62,
                                        ),
                                        name: "source",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    alias: None,
                                    temporal: None,
                                    with_options: None,
                                    pivot: None,
                                    unpivot: None,
                                    sample: None,
                                },
                            ],
                            selection: None,
                            group_by: Some(
                                Normal(
                                    [
                                        ColumnRef {
                                            span: Some(
                                                72..73,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            72..73,
                                                        ),
                                                        name: "v",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    ],
                                ),
                            ),
                            having: None,
                            window_list: None,
                            qualify: None,
                        },
                    ),
                    order_by: [],
                    limit: [],
                    offset: None,
                    ignore_result: false,
                },
            },
            delete_when: None,
        },
    ),
}


---------- Input ----------
explain pipeline select a from t1 ignore_result;
---------- Output ---------
EXPLAIN PIPELINE SELECT a FROM t1 IGNORE_RESULT
---------- AST ------------
Explain {
    kind: Pipeline,
    options: (
        None,
        [],
    ),
    query: Query(
        Query {
            span: Some(
                17..33,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        17..33,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    24..25,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                24..25,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                31..33,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    31..33,
                                ),
                                name: "t1",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: true,
        },
    ),
}


---------- Input ----------
explain(verbose, logical, optimized) select * from t where a = 1
---------- Output ---------
EXPLAIN(VERBOSE, LOGICAL, OPTIMIZED) SELECT * FROM t WHERE a = 1
---------- AST ------------
Explain {
    kind: Plan,
    options: (
        Some(
            7..36,
        ),
        [
            Verbose,
            Logical,
            Optimized,
        ],
    ),
    query: Query(
        Query {
            span: Some(
                37..64,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        37..64,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        StarColumns {
                            qualified: [
                                Star(
                                    Some(
                                        44..45,
                                    ),
                                ),
                            ],
                            column_filter: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                51..52,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    51..52,
                                ),
                                name: "t",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: Some(
                        BinaryOp {
                            span: Some(
                                61..62,
                            ),
                            op: Eq,
                            left: ColumnRef {
                                span: Some(
                                    59..60,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                59..60,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            right: Literal {
                                span: Some(
                                    63..64,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                        },
                    ),
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    ),
}


---------- Input ----------
describe a;
---------- Output ---------
DESCRIBE a
---------- AST ------------
DescribeTable(
    DescribeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                9..10,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
describe a format TabSeparatedWithNamesAndTypes;
---------- Output ---------
DESCRIBE a
---------- AST ------------
DescribeTable(
    DescribeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                9..10,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
    },
)


---------- FORMAT ------------
Some(
    "TabSeparatedWithNamesAndTypes",
)
---------- Input ----------
CREATE AGGREGATING INDEX idx1 AS SELECT SUM(a), b FROM t1 WHERE b > 3 GROUP BY b;
---------- Output ---------
CREATE AGGREGATING INDEX idx1 AS SELECT SUM(a), b FROM t1 WHERE b > 3 GROUP BY b
---------- AST ------------
CreateIndex(
    CreateIndexStmt {
        index_type: Aggregating,
        create_option: Create,
        index_name: Identifier {
            span: Some(
                25..29,
            ),
            name: "idx1",
            quote: None,
            ident_type: None,
        },
        query: Query {
            span: Some(
                33..80,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        33..80,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: FunctionCall {
                                span: Some(
                                    40..46,
                                ),
                                func: FunctionCall {
                                    distinct: false,
                                    name: Identifier {
                                        span: Some(
                                            40..43,
                                        ),
                                        name: "SUM",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    args: [
                                        ColumnRef {
                                            span: Some(
                                                44..45,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            44..45,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    ],
                                    params: [],
                                    order_by: [],
                                    window: None,
                                    lambda: None,
                                },
                            },
                            alias: None,
                        },
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    48..49,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                48..49,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                55..57,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    55..57,
                                ),
                                name: "t1",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: Some(
                        BinaryOp {
                            span: Some(
                                66..67,
                            ),
                            op: Gt,
                            left: ColumnRef {
                                span: Some(
                                    64..65,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                64..65,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            right: Literal {
                                span: Some(
                                    68..69,
                                ),
                                value: UInt64(
                                    3,
                                ),
                            },
                        },
                    ),
                    group_by: Some(
                        Normal(
                            [
                                ColumnRef {
                                    span: Some(
                                        79..80,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    79..80,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ),
                    ),
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
        sync_creation: true,
    },
)


---------- Input ----------
CREATE OR REPLACE AGGREGATING INDEX idx1 AS SELECT SUM(a), b FROM t1 WHERE b > 3 GROUP BY b;
---------- Output ---------
CREATE OR REPLACE AGGREGATING INDEX idx1 AS SELECT SUM(a), b FROM t1 WHERE b > 3 GROUP BY b
---------- AST ------------
CreateIndex(
    CreateIndexStmt {
        index_type: Aggregating,
        create_option: CreateOrReplace,
        index_name: Identifier {
            span: Some(
                36..40,
            ),
            name: "idx1",
            quote: None,
            ident_type: None,
        },
        query: Query {
            span: Some(
                44..91,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        44..91,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: FunctionCall {
                                span: Some(
                                    51..57,
                                ),
                                func: FunctionCall {
                                    distinct: false,
                                    name: Identifier {
                                        span: Some(
                                            51..54,
                                        ),
                                        name: "SUM",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    args: [
                                        ColumnRef {
                                            span: Some(
                                                55..56,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            55..56,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    ],
                                    params: [],
                                    order_by: [],
                                    window: None,
                                    lambda: None,
                                },
                            },
                            alias: None,
                        },
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    59..60,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                59..60,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                66..68,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    66..68,
                                ),
                                name: "t1",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: Some(
                        BinaryOp {
                            span: Some(
                                77..78,
                            ),
                            op: Gt,
                            left: ColumnRef {
                                span: Some(
                                    75..76,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                75..76,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            right: Literal {
                                span: Some(
                                    79..80,
                                ),
                                value: UInt64(
                                    3,
                                ),
                            },
                        },
                    ),
                    group_by: Some(
                        Normal(
                            [
                                ColumnRef {
                                    span: Some(
                                        90..91,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    90..91,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ),
                    ),
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
        sync_creation: true,
    },
)


---------- Input ----------
CREATE OR REPLACE INVERTED INDEX idx2 ON t1 (a, b);
---------- Output ---------
CREATE OR REPLACE INVERTED INDEX idx2 ON t1 (a, b)
---------- AST ------------
CreateTableIndex(
    CreateTableIndexStmt {
        create_option: CreateOrReplace,
        index_name: Identifier {
            span: Some(
                33..37,
            ),
            name: "idx2",
            quote: None,
            ident_type: None,
        },
        index_type: Inverted,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                41..43,
            ),
            name: "t1",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    45..46,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    48..49,
                ),
                name: "b",
                quote: None,
                ident_type: None,
            },
        ],
        sync_creation: true,
        index_options: {},
    },
)


---------- Input ----------
CREATE OR REPLACE NGRAM INDEX idx2 ON t1 (a, b);
---------- Output ---------
CREATE OR REPLACE NGRAM INDEX idx2 ON t1 (a, b)
---------- AST ------------
CreateTableIndex(
    CreateTableIndexStmt {
        create_option: CreateOrReplace,
        index_name: Identifier {
            span: Some(
                30..34,
            ),
            name: "idx2",
            quote: None,
            ident_type: None,
        },
        index_type: Ngram,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                38..40,
            ),
            name: "t1",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    42..43,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    45..46,
                ),
                name: "b",
                quote: None,
                ident_type: None,
            },
        ],
        sync_creation: true,
        index_options: {},
    },
)


---------- Input ----------
create table a (c decimal(38, 0))
---------- Output ---------
CREATE TABLE a (c Decimal(38, 0))
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                16..17,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Decimal {
                            precision: 38,
                            scale: 0,
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table a (c decimal(38))
---------- Output ---------
CREATE TABLE a (c Decimal(38, 0))
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                16..17,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Decimal {
                            precision: 38,
                            scale: 0,
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table a (c1 decimal(38), c2 int) partition by (c1, c2) PROPERTIES ("read.split.target-size"='134217728', "read.split.metadata-target-size"='33554432');
---------- Output ---------
CREATE TABLE a (c1 Decimal(38, 0), c2 Int32) PARTITION BY(c1, c2) PROPERTIES("read.split.metadata-target-size" = '33554432' "read.split.target-size" = '134217728')
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                16..18,
                            ),
                            name: "c1",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Decimal {
                            precision: 38,
                            scale: 0,
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..34,
                            ),
                            name: "c2",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: Some(
            [
                Identifier {
                    span: Some(
                        54..56,
                    ),
                    name: "c1",
                    quote: None,
                    ident_type: None,
                },
                Identifier {
                    span: Some(
                        58..60,
                    ),
                    name: "c2",
                    quote: None,
                    ident_type: None,
                },
            ],
        ),
        table_properties: Some(
            {
                "\"read.split.metadata-target-size\"": "33554432",
                "\"read.split.target-size\"": "134217728",
            },
        ),
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create or replace table a (c decimal(38))
---------- Output ---------
CREATE OR REPLACE TABLE a (c Decimal(38, 0))
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateOrReplace,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                24..25,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                27..28,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Decimal {
                            precision: 38,
                            scale: 0,
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create or replace table a (c int(10) unsigned)
---------- Output ---------
CREATE OR REPLACE TABLE a (c UInt32)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateOrReplace,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                24..25,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                27..28,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: UInt32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (c integer not null default 1, b varchar);
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (c Int32 NOT NULL DEFAULT 1, b STRING)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int32,
                        ),
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        59..60,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                62..63,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (c integer default 1 not null, b varchar) as select * from t;
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (c Int32 NOT NULL DEFAULT 1, b STRING) AS SELECT * FROM t
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int32,
                        ),
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        50..51,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                62..63,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: Some(
            Query {
                span: Some(
                    76..91,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            76..91,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            StarColumns {
                                qualified: [
                                    Star(
                                        Some(
                                            83..84,
                                        ),
                                    ),
                                ],
                                column_filter: None,
                            },
                        ],
                        from: [
                            Table {
                                span: Some(
                                    90..91,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        90..91,
                                    ),
                                    name: "t",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        ],
                        selection: None,
                        group_by: None,
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [],
                offset: None,
                ignore_result: false,
            },
        ),
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (c tuple(m integer, n string), d tuple(integer, string));
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (c TUPLE(m Int32, n STRING), d TUPLE(Int32, STRING))
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Tuple {
                            fields_name: Some(
                                [
                                    Identifier {
                                        span: Some(
                                            40..41,
                                        ),
                                        name: "m",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    Identifier {
                                        span: Some(
                                            51..52,
                                        ),
                                        name: "n",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ],
                            ),
                            fields_type: [
                                Int32,
                                String,
                            ],
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                62..63,
                            ),
                            name: "d",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Tuple {
                            fields_name: None,
                            fields_type: [
                                Int32,
                                String,
                            ],
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table a (b tuple("c-1" int, "c-2" uint64));
---------- Output ---------
CREATE TABLE a (b TUPLE("c-1" Int32, "c-2" UInt64))
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                16..17,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Tuple {
                            fields_name: Some(
                                [
                                    Identifier {
                                        span: Some(
                                            24..29,
                                        ),
                                        name: "c-1",
                                        quote: Some(
                                            '"',
                                        ),
                                        ident_type: None,
                                    },
                                    Identifier {
                                        span: Some(
                                            35..40,
                                        ),
                                        name: "c-2",
                                        quote: Some(
                                            '"',
                                        ),
                                        ident_type: None,
                                    },
                                ],
                            ),
                            fields_type: [
                                Int32,
                                UInt64,
                            ],
                        },
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (a string, b string, c string as (concat(a, ' ', b)) stored );
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (a STRING, b STRING, c STRING AS (concat(a, ' ', b)) STORED)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                42..43,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                52..53,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: Some(
                            Stored(
                                FunctionCall {
                                    span: Some(
                                        65..82,
                                    ),
                                    func: FunctionCall {
                                        distinct: false,
                                        name: Identifier {
                                            span: Some(
                                                65..71,
                                            ),
                                            name: "concat",
                                            quote: None,
                                            ident_type: None,
                                        },
                                        args: [
                                            ColumnRef {
                                                span: Some(
                                                    72..73,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                72..73,
                                                            ),
                                                            name: "a",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            Literal {
                                                span: Some(
                                                    75..78,
                                                ),
                                                value: String(
                                                    " ",
                                                ),
                                            },
                                            ColumnRef {
                                                span: Some(
                                                    80..81,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                80..81,
                                                            ),
                                                            name: "b",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                        ],
                                        params: [],
                                        order_by: [],
                                        window: None,
                                        lambda: None,
                                    },
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (a int, b int, c int generated always as (a + b) virtual );
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (a Int32, b Int32, c Int32 AS (a + b) VIRTUAL)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                39..40,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                46..47,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: Some(
                            Virtual(
                                BinaryOp {
                                    span: Some(
                                        75..76,
                                    ),
                                    op: Plus,
                                    left: ColumnRef {
                                        span: Some(
                                            73..74,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        73..74,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            77..78,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        77..78,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (a string, b string, inverted index idx1 (a,b) tokenizer='chinese');
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (a STRING, b STRING, INVERTED INDEX idx1 (a, b) tokenizer = 'chinese')
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                42..43,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: Some(
                    [
                        TableIndexDefinition {
                            index_name: Identifier {
                                span: Some(
                                    67..71,
                                ),
                                name: "idx1",
                                quote: None,
                                ident_type: None,
                            },
                            index_type: Inverted,
                            columns: [
                                Identifier {
                                    span: Some(
                                        73..74,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                Identifier {
                                    span: Some(
                                        75..76,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                            ],
                            sync_creation: true,
                            index_options: {
                                "tokenizer": "chinese",
                            },
                        },
                    ],
                ),
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (a string, b string, ngram index idx1 (a,b) gram_size=5);
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (a STRING, b STRING, NGRAM INDEX idx1 (a, b) gram_size = '5')
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                42..43,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: Some(
                    [
                        TableIndexDefinition {
                            index_name: Identifier {
                                span: Some(
                                    64..68,
                                ),
                                name: "idx1",
                                quote: None,
                                ident_type: None,
                            },
                            index_type: Ngram,
                            columns: [
                                Identifier {
                                    span: Some(
                                        70..71,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                Identifier {
                                    span: Some(
                                        72..73,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                            ],
                            sync_creation: true,
                            index_options: {
                                "gram_size": "5",
                            },
                        },
                    ],
                ),
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table a.b like c.d;
---------- Output ---------
CREATE TABLE a.b LIKE c.d
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Like {
                catalog: None,
                database: Some(
                    Identifier {
                        span: Some(
                            22..23,
                        ),
                        name: "c",
                        quote: None,
                        ident_type: None,
                    },
                ),
                table: Identifier {
                    span: Some(
                        24..25,
                    ),
                    name: "d",
                    quote: None,
                    ident_type: None,
                },
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table t like t2 engine = memory;
---------- Output ---------
CREATE TABLE t LIKE t2 ENGINE = MEMORY
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Like {
                catalog: None,
                database: None,
                table: Identifier {
                    span: Some(
                        20..22,
                    ),
                    name: "t2",
                    quote: None,
                    ident_type: None,
                },
            },
        ),
        engine: Some(
            Memory,
        ),
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table if not exists a.b (a int) 's3://testbucket/data/' connection=(aws_key_id='minioadmin' aws_secret_key='minioadmin' endpoint_url='http://127.0.0.1:9900');
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (a Int32) 's3://testbucket/data/' CONNECTION = ( aws_key_id = 'minioadmin', aws_secret_key = 'minioadmin', endpoint_url = 'http://127.0.0.1:9900' )
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                29..30,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: Some(
            UriLocation {
                protocol: "s3",
                name: "testbucket",
                path: "/data/",
                connection: Connection {
                    visited_keys: {},
                    conns: {
                        "aws_key_id": "minioadmin",
                        "aws_secret_key": "minioadmin",
                        "endpoint_url": "http://127.0.0.1:9900",
                    },
                },
            },
        ),
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
truncate table a;
---------- Output ---------
TRUNCATE TABLE a
---------- AST ------------
TruncateTable(
    TruncateTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
truncate table "a".b;
---------- Output ---------
TRUNCATE TABLE "a".b
---------- AST ------------
TruncateTable(
    TruncateTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    15..18,
                ),
                name: "a",
                quote: Some(
                    '"',
                ),
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                19..20,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
drop table a;
---------- Output ---------
DROP TABLE a
---------- AST ------------
DropTable(
    DropTableStmt {
        if_exists: false,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                11..12,
            ),
            name: "a",
            quote: None,
            ident_type: None,
        },
        all: false,
    },
)


---------- Input ----------
drop table if exists a."b";
---------- Output ---------
DROP TABLE IF EXISTS a."b"
---------- AST ------------
DropTable(
    DropTableStmt {
        if_exists: true,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    21..22,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                23..26,
            ),
            name: "b",
            quote: Some(
                '"',
            ),
            ident_type: None,
        },
        all: false,
    },
)


---------- Input ----------
use "a";
---------- Output ---------
USE "a"
---------- AST ------------
UseDatabase {
    database: Identifier {
        span: Some(
            4..7,
        ),
        name: "a",
        quote: Some(
            '"',
        ),
        ident_type: None,
    },
}


---------- Input ----------
create catalog ctl type=hive connection=(url='<hive-meta-store>' thrift_protocol='binary' warehouse='default');
---------- Output ---------
CREATE CATALOG ctl TYPE=HIVE CONNECTION = ( thrift_protocol = 'binary', url = '<hive-meta-store>', warehouse = 'default' )
---------- AST ------------
CreateCatalog(
    CreateCatalogStmt {
        if_not_exists: false,
        catalog_name: "ctl",
        catalog_type: Hive,
        catalog_options: {
            "thrift_protocol": "binary",
            "url": "<hive-meta-store>",
            "warehouse": "default",
        },
    },
)


---------- Input ----------
select current_catalog();
---------- Output ---------
SELECT current_catalog()
---------- AST ------------
Query(
    Query {
        span: Some(
            0..24,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..24,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..24,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..22,
                                    ),
                                    name: "current_catalog",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
use catalog ctl;
---------- Output ---------
USE CATALOG ctl
---------- AST ------------
UseCatalog {
    catalog: Identifier {
        span: Some(
            12..15,
        ),
        name: "ctl",
        quote: None,
        ident_type: None,
    },
}


---------- Input ----------
catalog ctl;
---------- Output ---------
USE CATALOG ctl
---------- AST ------------
UseCatalog {
    catalog: Identifier {
        span: Some(
            8..11,
        ),
        name: "ctl",
        quote: None,
        ident_type: None,
    },
}


---------- Input ----------
set catalog ctl;
---------- Output ---------
USE CATALOG ctl
---------- AST ------------
UseCatalog {
    catalog: Identifier {
        span: Some(
            12..15,
        ),
        name: "ctl",
        quote: None,
        ident_type: None,
    },
}


---------- Input ----------
create database if not exists a;
---------- Output ---------
CREATE DATABASE IF NOT EXISTS a
---------- AST ------------
CreateDatabase(
    CreateDatabaseStmt {
        create_option: CreateIfNotExists,
        database: DatabaseRef {
            catalog: None,
            database: Identifier {
                span: Some(
                    30..31,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        },
        engine: None,
        options: [],
    },
)


---------- Input ----------
create database ctl.t engine = Default;
---------- Output ---------
CREATE DATABASE ctl.t ENGINE = DEFAULT
---------- AST ------------
CreateDatabase(
    CreateDatabaseStmt {
        create_option: Create,
        database: DatabaseRef {
            catalog: Some(
                Identifier {
                    span: Some(
                        16..19,
                    ),
                    name: "ctl",
                    quote: None,
                    ident_type: None,
                },
            ),
            database: Identifier {
                span: Some(
                    20..21,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
        },
        engine: Some(
            Default,
        ),
        options: [],
    },
)


---------- Input ----------
create database t engine = Default;
---------- Output ---------
CREATE DATABASE t ENGINE = DEFAULT
---------- AST ------------
CreateDatabase(
    CreateDatabaseStmt {
        create_option: Create,
        database: DatabaseRef {
            catalog: None,
            database: Identifier {
                span: Some(
                    16..17,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
        },
        engine: Some(
            Default,
        ),
        options: [],
    },
)


---------- Input ----------
CREATE TABLE `t3`(a int not null, b int not null, c int not null) bloom_index_columns='a,b,c' COMPRESSION='zstd' STORAGE_FORMAT='native';
---------- Output ---------
CREATE TABLE `t3` (a Int32 NOT NULL, b Int32 NOT NULL, c Int32 NOT NULL) bloom_index_columns = 'a,b,c' compression = 'zstd' storage_format = 'native'
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..17,
            ),
            name: "t3",
            quote: Some(
                '`',
            ),
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                18..19,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int32,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                34..35,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int32,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                50..51,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int32,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {
            "bloom_index_columns": "a,b,c",
            "compression": "zstd",
            "storage_format": "native",
        },
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create or replace database a;
---------- Output ---------
CREATE OR REPLACE DATABASE a
---------- AST ------------
CreateDatabase(
    CreateDatabaseStmt {
        create_option: CreateOrReplace,
        database: DatabaseRef {
            catalog: None,
            database: Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        },
        engine: None,
        options: [],
    },
)


---------- Input ----------
drop database ctl.t;
---------- Output ---------
DROP DATABASE ctl.t
---------- AST ------------
DropDatabase(
    DropDatabaseStmt {
        if_exists: false,
        catalog: Some(
            Identifier {
                span: Some(
                    14..17,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Identifier {
            span: Some(
                18..19,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
drop database if exists t;
---------- Output ---------
DROP DATABASE IF EXISTS t
---------- AST ------------
DropDatabase(
    DropDatabaseStmt {
        if_exists: true,
        catalog: None,
        database: Identifier {
            span: Some(
                24..25,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
create table c(a DateTime null, b DateTime(3));
---------- Output ---------
CREATE TABLE c (a TIMESTAMP NULL, b TIMESTAMP)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "c",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                15..16,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            Timestamp,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..33,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Timestamp,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create view v as select number % 3 as a from numbers(1000);
---------- Output ---------
CREATE VIEW v AS SELECT number % 3 AS a FROM numbers(1000)
---------- AST ------------
CreateView(
    CreateViewStmt {
        create_option: Create,
        catalog: None,
        database: None,
        view: Identifier {
            span: Some(
                12..13,
            ),
            name: "v",
            quote: None,
            ident_type: None,
        },
        columns: [],
        query: Query {
            span: Some(
                17..58,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        17..58,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: BinaryOp {
                                span: Some(
                                    31..32,
                                ),
                                op: Modulo,
                                left: ColumnRef {
                                    span: Some(
                                        24..30,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    24..30,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        33..34,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                            },
                            alias: Some(
                                Identifier {
                                    span: Some(
                                        38..39,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    ],
                    from: [
                        TableFunction {
                            span: Some(
                                45..58,
                            ),
                            lateral: false,
                            name: Identifier {
                                span: Some(
                                    45..52,
                                ),
                                name: "numbers",
                                quote: None,
                                ident_type: None,
                            },
                            params: [
                                Literal {
                                    span: Some(
                                        53..57,
                                    ),
                                    value: UInt64(
                                        1000,
                                    ),
                                },
                            ],
                            named_params: [],
                            alias: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
alter view v as select number % 3 as a from numbers(1000);
---------- Output ---------
ALTER VIEW v AS SELECT number % 3 AS a FROM numbers(1000)
---------- AST ------------
AlterView(
    AlterViewStmt {
        catalog: None,
        database: None,
        view: Identifier {
            span: Some(
                11..12,
            ),
            name: "v",
            quote: None,
            ident_type: None,
        },
        columns: [],
        query: Query {
            span: Some(
                16..57,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        16..57,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: BinaryOp {
                                span: Some(
                                    30..31,
                                ),
                                op: Modulo,
                                left: ColumnRef {
                                    span: Some(
                                        23..29,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    23..29,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        32..33,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                            },
                            alias: Some(
                                Identifier {
                                    span: Some(
                                        37..38,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    ],
                    from: [
                        TableFunction {
                            span: Some(
                                44..57,
                            ),
                            lateral: false,
                            name: Identifier {
                                span: Some(
                                    44..51,
                                ),
                                name: "numbers",
                                quote: None,
                                ident_type: None,
                            },
                            params: [
                                Literal {
                                    span: Some(
                                        52..56,
                                    ),
                                    value: UInt64(
                                        1000,
                                    ),
                                },
                            ],
                            named_params: [],
                            alias: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
drop view v;
---------- Output ---------
DROP VIEW v
---------- AST ------------
DropView(
    DropViewStmt {
        if_exists: false,
        catalog: None,
        database: None,
        view: Identifier {
            span: Some(
                10..11,
            ),
            name: "v",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
create view v1(c1) as select number % 3 as a from numbers(1000);
---------- Output ---------
CREATE VIEW v1 (c1) AS SELECT number % 3 AS a FROM numbers(1000)
---------- AST ------------
CreateView(
    CreateViewStmt {
        create_option: Create,
        catalog: None,
        database: None,
        view: Identifier {
            span: Some(
                12..14,
            ),
            name: "v1",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    15..17,
                ),
                name: "c1",
                quote: None,
                ident_type: None,
            },
        ],
        query: Query {
            span: Some(
                22..63,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        22..63,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: BinaryOp {
                                span: Some(
                                    36..37,
                                ),
                                op: Modulo,
                                left: ColumnRef {
                                    span: Some(
                                        29..35,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    29..35,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        38..39,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                            },
                            alias: Some(
                                Identifier {
                                    span: Some(
                                        43..44,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    ],
                    from: [
                        TableFunction {
                            span: Some(
                                50..63,
                            ),
                            lateral: false,
                            name: Identifier {
                                span: Some(
                                    50..57,
                                ),
                                name: "numbers",
                                quote: None,
                                ident_type: None,
                            },
                            params: [
                                Literal {
                                    span: Some(
                                        58..62,
                                    ),
                                    value: UInt64(
                                        1000,
                                    ),
                                },
                            ],
                            named_params: [],
                            alias: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
create or replace view v1(c1) as select number % 3 as a from numbers(1000);
---------- Output ---------
CREATE OR REPLACE VIEW v1 (c1) AS SELECT number % 3 AS a FROM numbers(1000)
---------- AST ------------
CreateView(
    CreateViewStmt {
        create_option: CreateOrReplace,
        catalog: None,
        database: None,
        view: Identifier {
            span: Some(
                23..25,
            ),
            name: "v1",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    26..28,
                ),
                name: "c1",
                quote: None,
                ident_type: None,
            },
        ],
        query: Query {
            span: Some(
                33..74,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        33..74,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: BinaryOp {
                                span: Some(
                                    47..48,
                                ),
                                op: Modulo,
                                left: ColumnRef {
                                    span: Some(
                                        40..46,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    40..46,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        49..50,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                            },
                            alias: Some(
                                Identifier {
                                    span: Some(
                                        54..55,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    ],
                    from: [
                        TableFunction {
                            span: Some(
                                61..74,
                            ),
                            lateral: false,
                            name: Identifier {
                                span: Some(
                                    61..68,
                                ),
                                name: "numbers",
                                quote: None,
                                ident_type: None,
                            },
                            params: [
                                Literal {
                                    span: Some(
                                        69..73,
                                    ),
                                    value: UInt64(
                                        1000,
                                    ),
                                },
                            ],
                            named_params: [],
                            alias: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
alter view v1(c2) as select number % 3 as a from numbers(1000);
---------- Output ---------
ALTER VIEW v1 (c2) AS SELECT number % 3 AS a FROM numbers(1000)
---------- AST ------------
AlterView(
    AlterViewStmt {
        catalog: None,
        database: None,
        view: Identifier {
            span: Some(
                11..13,
            ),
            name: "v1",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    14..16,
                ),
                name: "c2",
                quote: None,
                ident_type: None,
            },
        ],
        query: Query {
            span: Some(
                21..62,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        21..62,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: BinaryOp {
                                span: Some(
                                    35..36,
                                ),
                                op: Modulo,
                                left: ColumnRef {
                                    span: Some(
                                        28..34,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    28..34,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        37..38,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                            },
                            alias: Some(
                                Identifier {
                                    span: Some(
                                        42..43,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    ],
                    from: [
                        TableFunction {
                            span: Some(
                                49..62,
                            ),
                            lateral: false,
                            name: Identifier {
                                span: Some(
                                    49..56,
                                ),
                                name: "numbers",
                                quote: None,
                                ident_type: None,
                            },
                            params: [
                                Literal {
                                    span: Some(
                                        57..61,
                                    ),
                                    value: UInt64(
                                        1000,
                                    ),
                                },
                            ],
                            named_params: [],
                            alias: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
show views
---------- Output ---------
SHOW VIEWS
---------- AST ------------
ShowViews(
    ShowViewsStmt {
        catalog: None,
        database: None,
        full: false,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show views format TabSeparatedWithNamesAndTypes;
---------- Output ---------
SHOW VIEWS
---------- AST ------------
ShowViews(
    ShowViewsStmt {
        catalog: None,
        database: None,
        full: false,
        limit: None,
        with_history: false,
    },
)


---------- FORMAT ------------
Some(
    "TabSeparatedWithNamesAndTypes",
)
---------- Input ----------
show full views
---------- Output ---------
SHOW FULL VIEWS
---------- AST ------------
ShowViews(
    ShowViewsStmt {
        catalog: None,
        database: None,
        full: true,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show full views from db
---------- Output ---------
SHOW FULL VIEWS FROM db
---------- AST ------------
ShowViews(
    ShowViewsStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    21..23,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        full: true,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
show full views from ctl.db
---------- Output ---------
SHOW FULL VIEWS FROM ctl.db
---------- AST ------------
ShowViews(
    ShowViewsStmt {
        catalog: Some(
            Identifier {
                span: Some(
                    21..24,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Some(
            Identifier {
                span: Some(
                    25..27,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        full: true,
        limit: None,
        with_history: false,
    },
)


---------- Input ----------
create stream test2.s1 on table test.t append_only = false;
---------- Output ---------
CREATE STREAM test2.s1 ON TABLE test.t APPEND_ONLY = false
---------- AST ------------
CreateStream(
    CreateStreamStmt {
        create_option: Create,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    14..19,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                20..22,
            ),
            name: "s1",
            quote: None,
            ident_type: None,
        },
        table_database: Some(
            Identifier {
                span: Some(
                    32..36,
                ),
                name: "test",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                37..38,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        travel_point: None,
        append_only: false,
        comment: None,
    },
)


---------- Input ----------
create stream if not exists test2.s2 on table test.t at (stream => test1.s1) comment = 'this is a stream';
---------- Output ---------
CREATE STREAM IF NOT EXISTS test2.s2 ON TABLE test.t AT (STREAM => test1.s1) COMMENT = 'this is a stream'
---------- AST ------------
CreateStream(
    CreateStreamStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    28..33,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                34..36,
            ),
            name: "s2",
            quote: None,
            ident_type: None,
        },
        table_database: Some(
            Identifier {
                span: Some(
                    46..50,
                ),
                name: "test",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                51..52,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        travel_point: Some(
            Stream {
                catalog: None,
                database: Some(
                    Identifier {
                        span: Some(
                            67..72,
                        ),
                        name: "test1",
                        quote: None,
                        ident_type: None,
                    },
                ),
                name: Identifier {
                    span: Some(
                        73..75,
                    ),
                    name: "s1",
                    quote: None,
                    ident_type: None,
                },
            },
        ),
        append_only: true,
        comment: Some(
            "this is a stream",
        ),
    },
)


---------- Input ----------
create stream if not exists test2.s3 on table test.t at (TIMESTAMP => '2023-06-26 09:49:02.038483'::TIMESTAMP) append_only = false;
---------- Output ---------
CREATE STREAM IF NOT EXISTS test2.s3 ON TABLE test.t AT (TIMESTAMP => '2023-06-26 09:49:02.038483'::TIMESTAMP) APPEND_ONLY = false
---------- AST ------------
CreateStream(
    CreateStreamStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    28..33,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                34..36,
            ),
            name: "s3",
            quote: None,
            ident_type: None,
        },
        table_database: Some(
            Identifier {
                span: Some(
                    46..50,
                ),
                name: "test",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                51..52,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        travel_point: Some(
            Timestamp(
                Cast {
                    span: Some(
                        98..109,
                    ),
                    expr: Literal {
                        span: Some(
                            70..98,
                        ),
                        value: String(
                            "2023-06-26 09:49:02.038483",
                        ),
                    },
                    target_type: Timestamp,
                    pg_style: true,
                },
            ),
        ),
        append_only: false,
        comment: None,
    },
)


---------- Input ----------
create stream if not exists test2.s3 on table test.t at (SNAPSHOT => '9828b23f74664ff3806f44bbc1925ea5') append_only = true;
---------- Output ---------
CREATE STREAM IF NOT EXISTS test2.s3 ON TABLE test.t AT (SNAPSHOT => '9828b23f74664ff3806f44bbc1925ea5')
---------- AST ------------
CreateStream(
    CreateStreamStmt {
        create_option: CreateIfNotExists,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    28..33,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                34..36,
            ),
            name: "s3",
            quote: None,
            ident_type: None,
        },
        table_database: Some(
            Identifier {
                span: Some(
                    46..50,
                ),
                name: "test",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                51..52,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        travel_point: Some(
            Snapshot(
                "9828b23f74664ff3806f44bbc1925ea5",
            ),
        ),
        append_only: true,
        comment: None,
    },
)


---------- Input ----------
create or replace stream test2.s1 on table test.t append_only = false;
---------- Output ---------
CREATE OR REPLACE STREAM test2.s1 ON TABLE test.t APPEND_ONLY = false
---------- AST ------------
CreateStream(
    CreateStreamStmt {
        create_option: CreateOrReplace,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    25..30,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                31..33,
            ),
            name: "s1",
            quote: None,
            ident_type: None,
        },
        table_database: Some(
            Identifier {
                span: Some(
                    43..47,
                ),
                name: "test",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                48..49,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        travel_point: None,
        append_only: false,
        comment: None,
    },
)


---------- Input ----------
show full streams from default.test2 like 's%';
---------- Output ---------
SHOW FULL STREAMS FROM default.test2 LIKE 's%'
---------- AST ------------
ShowStreams(
    ShowStreamsStmt {
        catalog: Some(
            Identifier {
                span: Some(
                    23..30,
                ),
                name: "default",
                quote: None,
                ident_type: None,
            },
        ),
        database: Some(
            Identifier {
                span: Some(
                    31..36,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        full: true,
        limit: Some(
            Like {
                pattern: "s%",
            },
        ),
    },
)


---------- Input ----------
describe stream test2.s2;
---------- Output ---------
DESCRIBE STREAM test2.s2
---------- AST ------------
DescribeStream(
    DescribeStreamStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    16..21,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                22..24,
            ),
            name: "s2",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
drop stream if exists test2.s2;
---------- Output ---------
DROP STREAM IF EXISTS test2.s2
---------- AST ------------
DropStream(
    DropStreamStmt {
        if_exists: true,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    22..27,
                ),
                name: "test2",
                quote: None,
                ident_type: None,
            },
        ),
        stream: Identifier {
            span: Some(
                28..30,
            ),
            name: "s2",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
rename table d.t to e.s;
---------- Output ---------
RENAME TABLE d.t TO e.s
---------- AST ------------
RenameTable(
    RenameTableStmt {
        if_exists: false,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "d",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        new_catalog: None,
        new_database: Some(
            Identifier {
                span: Some(
                    20..21,
                ),
                name: "e",
                quote: None,
                ident_type: None,
            },
        ),
        new_table: Identifier {
            span: Some(
                22..23,
            ),
            name: "s",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
truncate table test;
---------- Output ---------
TRUNCATE TABLE test
---------- AST ------------
TruncateTable(
    TruncateTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                15..19,
            ),
            name: "test",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
truncate table test_db.test;
---------- Output ---------
TRUNCATE TABLE test_db.test
---------- AST ------------
TruncateTable(
    TruncateTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    15..22,
                ),
                name: "test_db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                23..27,
            ),
            name: "test",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
DROP table table1;
---------- Output ---------
DROP TABLE table1
---------- AST ------------
DropTable(
    DropTableStmt {
        if_exists: false,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                11..17,
            ),
            name: "table1",
            quote: None,
            ident_type: None,
        },
        all: false,
    },
)


---------- Input ----------
DROP table IF EXISTS table1;
---------- Output ---------
DROP TABLE IF EXISTS table1
---------- AST ------------
DropTable(
    DropTableStmt {
        if_exists: true,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                21..27,
            ),
            name: "table1",
            quote: None,
            ident_type: None,
        },
        all: false,
    },
)


---------- Input ----------
create role role1 comment='test';
---------- Output ---------
CREATE ROLE 'role1' COMMENT = 'test'
---------- AST ------------
CreateRole {
    create_option: Create,
    role_name: "role1",
    comment: Some(
        "test",
    ),
}


---------- Input ----------
alter role role1 set comment='test';
---------- Output ---------
ALTER ROLE role1 SET COMMENT = 'test'
---------- AST ------------
AlterRole(
    AlterRoleStmt {
        if_exists: false,
        name: "role1",
        action: Comment(
            Some(
                "test",
            ),
        ),
    },
)


---------- Input ----------
alter role role1 unset comment;
---------- Output ---------
ALTER ROLE role1 UNSET COMMENT
---------- AST ------------
AlterRole(
    AlterRoleStmt {
        if_exists: false,
        name: "role1",
        action: Comment(
            None,
        ),
    },
)


---------- Input ----------
CREATE TABLE t(c1 int null, c2 bigint null, c3 varchar null);
---------- Output ---------
CREATE TABLE t (c1 Int32 NULL, c2 Int64 NULL, c3 STRING NULL)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                15..17,
                            ),
                            name: "c1",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            Int32,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                28..30,
                            ),
                            name: "c2",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            Int64,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                44..46,
                            ),
                            name: "c3",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            String,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
CREATE TABLE t(c1 int not null, c2 bigint not null, c3 varchar not null);
---------- Output ---------
CREATE TABLE t (c1 Int32 NOT NULL, c2 Int64 NOT NULL, c3 STRING NOT NULL)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                15..17,
                            ),
                            name: "c1",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int32,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                32..34,
                            ),
                            name: "c2",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Int64,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                52..54,
                            ),
                            name: "c3",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            String,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
CREATE TABLE t(c1 varbinary, c2 binary(10));
---------- Output ---------
CREATE TABLE t (c1 BINARY, c2 BINARY)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                15..17,
                            ),
                            name: "c1",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Binary,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                29..31,
                            ),
                            name: "c2",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Binary,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
CREATE TABLE t(c1 int default 1);
---------- Output ---------
CREATE TABLE t (c1 Int32 DEFAULT 1)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                15..17,
                            ),
                            name: "c1",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        30..31,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table abc as (select * from xyz limit 10)
---------- Output ---------
CREATE TABLE abc AS SELECT * FROM xyz LIMIT 10
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..16,
            ),
            name: "abc",
            quote: None,
            ident_type: None,
        },
        source: None,
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: Some(
            Query {
                span: Some(
                    21..38,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            21..38,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            StarColumns {
                                qualified: [
                                    Star(
                                        Some(
                                            28..29,
                                        ),
                                    ),
                                ],
                                column_filter: None,
                            },
                        ],
                        from: [
                            Table {
                                span: Some(
                                    35..38,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        35..38,
                                    ),
                                    name: "xyz",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        ],
                        selection: None,
                        group_by: None,
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [
                    Literal {
                        span: Some(
                            45..47,
                        ),
                        value: UInt64(
                            10,
                        ),
                    },
                ],
                offset: None,
                ignore_result: false,
            },
        ),
        table_type: Normal,
    },
)


---------- Input ----------
create table a.b (c integer autoincrement (10, 20) ORDER)
---------- Output ---------
CREATE TABLE a.b (c Int32 AUTOINCREMENT (10, 20) ORDER)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                18..19,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: Some(
                            AutoIncrement {
                                start: 10,
                                step: 20,
                                is_ordered: true,
                            },
                        ),
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
create table a.b (c integer identity START 10 INCREMENT 20)
---------- Output ---------
CREATE TABLE a.b (c Int32 AUTOINCREMENT (10, 20) ORDER)
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "b",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                18..19,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: Some(
                            AutoIncrement {
                                start: 10,
                                step: 20,
                                is_ordered: true,
                            },
                        ),
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
ALTER USER u1 IDENTIFIED BY '123456';
---------- Output ---------
ALTER USER 'u1'@'%' IDENTIFIED BY '123456'
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: Some(
            AuthOption {
                auth_type: None,
                password: Some(
                    "123456",
                ),
            },
        ),
        user_options: [],
    },
)


---------- Input ----------
ALTER USER u1 WITH disabled = false;
---------- Output ---------
ALTER USER 'u1'@'%' WITH DISABLED = false
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            Disabled(
                false,
            ),
        ],
    },
)


---------- Input ----------
ALTER USER u1 WITH default_role = role1;
---------- Output ---------
ALTER USER 'u1'@'%' WITH DEFAULT_ROLE = 'role1'
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            DefaultRole(
                "role1",
            ),
        ],
    },
)


---------- Input ----------
ALTER USER u1 WITH DEFAULT_ROLE = role1, DISABLED=true, TENANTSETTING;
---------- Output ---------
ALTER USER 'u1'@'%' WITH DEFAULT_ROLE = 'role1', DISABLED = true, TENANTSETTING
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            DefaultRole(
                "role1",
            ),
            Disabled(
                true,
            ),
            TenantSetting(
                true,
            ),
        ],
    },
)


---------- Input ----------
ALTER USER u1 WITH SET NETWORK POLICY = 'policy1';
---------- Output ---------
ALTER USER 'u1'@'%' WITH SET NETWORK POLICY = 'policy1'
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            SetNetworkPolicy(
                "policy1",
            ),
        ],
    },
)


---------- Input ----------
ALTER USER u1 WITH UNSET NETWORK POLICY;
---------- Output ---------
ALTER USER 'u1'@'%' WITH UNSET NETWORK POLICY
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            UnsetNetworkPolicy,
        ],
    },
)


---------- Input ----------
CREATE USER u1 IDENTIFIED BY '123456' WITH SET WORKLOAD GROUP='W1'
---------- Output ---------
CREATE USER 'u1'@'%' IDENTIFIED BY '123456' WITH SET WORKLOAD GROUP = 'W1'
---------- AST ------------
CreateUser(
    CreateUserStmt {
        create_option: Create,
        user: UserIdentity {
            username: "u1",
            hostname: "%",
        },
        auth_option: AuthOption {
            auth_type: None,
            password: Some(
                "123456",
            ),
        },
        user_options: [
            SetWorkloadGroup(
                "W1",
            ),
        ],
    },
)


---------- Input ----------
ALTER USER u1 WITH SET WORKLOAD GROUP = 'W1';
---------- Output ---------
ALTER USER 'u1'@'%' WITH SET WORKLOAD GROUP = 'W1'
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            SetWorkloadGroup(
                "W1",
            ),
        ],
    },
)


---------- Input ----------
ALTER USER u1 WITH UNSET WORKLOAD GROUP;
---------- Output ---------
ALTER USER 'u1'@'%' WITH UNSET WORKLOAD GROUP
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
        auth_option: None,
        user_options: [
            UnsetWorkloadGroup,
        ],
    },
)


---------- Input ----------
CREATE USER u1 IDENTIFIED BY '123456' WITH DEFAULT_ROLE='role123', TENANTSETTING
---------- Output ---------
CREATE USER 'u1'@'%' IDENTIFIED BY '123456' WITH DEFAULT_ROLE = 'role123', TENANTSETTING
---------- AST ------------
CreateUser(
    CreateUserStmt {
        create_option: Create,
        user: UserIdentity {
            username: "u1",
            hostname: "%",
        },
        auth_option: AuthOption {
            auth_type: None,
            password: Some(
                "123456",
            ),
        },
        user_options: [
            DefaultRole(
                "role123",
            ),
            TenantSetting(
                true,
            ),
        ],
    },
)


---------- Input ----------
CREATE USER u1 IDENTIFIED BY '123456' WITH SET NETWORK POLICY='policy1'
---------- Output ---------
CREATE USER 'u1'@'%' IDENTIFIED BY '123456' WITH SET NETWORK POLICY = 'policy1'
---------- AST ------------
CreateUser(
    CreateUserStmt {
        create_option: Create,
        user: UserIdentity {
            username: "u1",
            hostname: "%",
        },
        auth_option: AuthOption {
            auth_type: None,
            password: Some(
                "123456",
            ),
        },
        user_options: [
            SetNetworkPolicy(
                "policy1",
            ),
        ],
    },
)


---------- Input ----------
CREATE USER u1 IDENTIFIED BY '123456' WITH disabled=true
---------- Output ---------
CREATE USER 'u1'@'%' IDENTIFIED BY '123456' WITH DISABLED = true
---------- AST ------------
CreateUser(
    CreateUserStmt {
        create_option: Create,
        user: UserIdentity {
            username: "u1",
            hostname: "%",
        },
        auth_option: AuthOption {
            auth_type: None,
            password: Some(
                "123456",
            ),
        },
        user_options: [
            Disabled(
                true,
            ),
        ],
    },
)


---------- Input ----------
DROP database if exists db1;
---------- Output ---------
DROP DATABASE IF EXISTS db1
---------- AST ------------
DropDatabase(
    DropDatabaseStmt {
        if_exists: true,
        catalog: None,
        database: Identifier {
            span: Some(
                24..27,
            ),
            name: "db1",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
select distinct a, count(*) from t where a = 1 and b - 1 < a group by a having a = 1;
---------- Output ---------
SELECT DISTINCT a, COUNT(*) FROM t WHERE a = 1 AND b - 1 < a GROUP BY a HAVING a = 1
---------- AST ------------
Query(
    Query {
        span: Some(
            0..84,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..84,
                ),
                hints: None,
                distinct: true,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                16..17,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            16..17,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                    AliasedExpr {
                        expr: CountAll {
                            span: Some(
                                19..27,
                            ),
                            qualified: [
                                Star(
                                    Some(
                                        25..26,
                                    ),
                                ),
                            ],
                            window: None,
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            33..34,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                33..34,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            47..50,
                        ),
                        op: And,
                        left: BinaryOp {
                            span: Some(
                                43..44,
                            ),
                            op: Eq,
                            left: ColumnRef {
                                span: Some(
                                    41..42,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                41..42,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            right: Literal {
                                span: Some(
                                    45..46,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                        },
                        right: BinaryOp {
                            span: Some(
                                57..58,
                            ),
                            op: Lt,
                            left: BinaryOp {
                                span: Some(
                                    53..54,
                                ),
                                op: Minus,
                                left: ColumnRef {
                                    span: Some(
                                        51..52,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    51..52,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        55..56,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            },
                            right: ColumnRef {
                                span: Some(
                                    59..60,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                59..60,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        },
                    },
                ),
                group_by: Some(
                    Normal(
                        [
                            ColumnRef {
                                span: Some(
                                    70..71,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                70..71,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                    ),
                ),
                having: Some(
                    BinaryOp {
                        span: Some(
                            81..82,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                79..80,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            79..80,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                83..84,
                            ),
                            value: UInt64(
                                1,
                            ),
                        },
                    },
                ),
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from t4;
---------- Output ---------
SELECT * FROM t4
---------- AST ------------
Query(
    Query {
        span: Some(
            0..16,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..16,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..16,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..16,
                            ),
                            name: "t4",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select top 2 * from t4;
---------- Output ---------
SELECT TOP 2 * FROM t4
---------- AST ------------
Query(
    Query {
        span: Some(
            0..22,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..22,
                ),
                hints: None,
                distinct: false,
                top_n: Some(
                    2,
                ),
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    13..14,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            20..22,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                20..22,
                            ),
                            name: "t4",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from aa.bb;
---------- Output ---------
SELECT * FROM aa.bb
---------- AST ------------
Query(
    Query {
        span: Some(
            0..19,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..19,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..19,
                        ),
                        catalog: None,
                        database: Some(
                            Identifier {
                                span: Some(
                                    14..16,
                                ),
                                name: "aa",
                                quote: None,
                                ident_type: None,
                            },
                        ),
                        table: Identifier {
                            span: Some(
                                17..19,
                            ),
                            name: "bb",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
from aa.bb select *;
---------- Output ---------
SELECT * FROM aa.bb
---------- AST ------------
Query(
    Query {
        span: Some(
            0..19,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..19,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    18..19,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            5..10,
                        ),
                        catalog: None,
                        database: Some(
                            Identifier {
                                span: Some(
                                    5..7,
                                ),
                                name: "aa",
                                quote: None,
                                ident_type: None,
                            },
                        ),
                        table: Identifier {
                            span: Some(
                                8..10,
                            ),
                            name: "bb",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
from aa.bb
---------- Output ---------
SELECT * FROM aa.bb
---------- AST ------------
Query(
    Query {
        span: Some(
            0..10,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..10,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    0..0,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            5..10,
                        ),
                        catalog: None,
                        database: Some(
                            Identifier {
                                span: Some(
                                    5..7,
                                ),
                                name: "aa",
                                quote: None,
                                ident_type: None,
                            },
                        ),
                        table: Identifier {
                            span: Some(
                                8..10,
                            ),
                            name: "bb",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a, b, c;
---------- Output ---------
SELECT * FROM a, b, c
---------- AST ------------
Query(
    Query {
        span: Some(
            0..21,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..21,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                    Table {
                        span: Some(
                            17..18,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                17..18,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                    Table {
                        span: Some(
                            20..21,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                20..21,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a, b, c order by "db"."a"."c1";
---------- Output ---------
SELECT * FROM a, b, c ORDER BY "db"."a"."c1"
---------- AST ------------
Query(
    Query {
        span: Some(
            0..21,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..21,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                    Table {
                        span: Some(
                            17..18,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                17..18,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                    Table {
                        span: Some(
                            20..21,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                20..21,
                            ),
                            name: "c",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [
            OrderByExpr {
                expr: ColumnRef {
                    span: Some(
                        31..35,
                    ),
                    column: ColumnRef {
                        database: Some(
                            Identifier {
                                span: Some(
                                    31..35,
                                ),
                                name: "db",
                                quote: Some(
                                    '"',
                                ),
                                ident_type: None,
                            },
                        ),
                        table: Some(
                            Identifier {
                                span: Some(
                                    36..39,
                                ),
                                name: "a",
                                quote: Some(
                                    '"',
                                ),
                                ident_type: None,
                            },
                        ),
                        column: Name(
                            Identifier {
                                span: Some(
                                    40..44,
                                ),
                                name: "c1",
                                quote: Some(
                                    '"',
                                ),
                                ident_type: None,
                            },
                        ),
                    },
                },
                asc: None,
                nulls_first: None,
            },
        ],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a INNER JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..35,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..35,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..20,
                        ),
                        join: Join {
                            op: Inner,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        30..31,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            26..27,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        26..27,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        28..29,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            32..33,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        32..33,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        34..35,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    21..22,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        21..22,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a left outer join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a LEFT OUTER JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..46,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..46,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..31,
                        ),
                        join: Join {
                            op: LeftOuter,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        41..42,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            37..38,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        37..38,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            43..44,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        43..44,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        45..46,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    32..33,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        32..33,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a right outer join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a RIGHT OUTER JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..47,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..47,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..32,
                        ),
                        join: Join {
                            op: RightOuter,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        42..43,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            38..39,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        38..39,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        40..41,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            44..45,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        44..45,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        46..47,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    33..34,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        33..34,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a left semi join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a LEFT SEMI JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..45,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..45,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..30,
                        ),
                        join: Join {
                            op: LeftSemi,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        40..41,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            36..37,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        36..37,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        38..39,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            42..43,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        42..43,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        44..45,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    31..32,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        31..32,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a semi join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a LEFT SEMI JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..40,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..40,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..25,
                        ),
                        join: Join {
                            op: LeftSemi,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        35..36,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            31..32,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        31..32,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        33..34,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            37..38,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        37..38,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    26..27,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        26..27,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a left anti join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a LEFT ANTI JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..45,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..45,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..30,
                        ),
                        join: Join {
                            op: LeftAnti,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        40..41,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            36..37,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        36..37,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        38..39,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            42..43,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        42..43,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        44..45,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    31..32,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        31..32,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a anti join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a LEFT ANTI JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..40,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..40,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..25,
                        ),
                        join: Join {
                            op: LeftAnti,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        35..36,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            31..32,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        31..32,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        33..34,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            37..38,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        37..38,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    26..27,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        26..27,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SETTINGS (max_thread=1, timezone='Asia/Shanghai') select 1;
---------- Output ---------
SETTINGS (max_thread = 1, timezone = 'Asia/Shanghai') SELECT 1
---------- AST ------------
StatementWithSettings {
    settings: Some(
        Settings {
            set_type: SettingsQuery,
            identifiers: [
                Identifier {
                    span: Some(
                        10..20,
                    ),
                    name: "max_thread",
                    quote: None,
                    ident_type: None,
                },
                Identifier {
                    span: Some(
                        24..32,
                    ),
                    name: "timezone",
                    quote: None,
                    ident_type: None,
                },
            ],
            values: Expr(
                [
                    Literal {
                        span: Some(
                            21..22,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                    Literal {
                        span: Some(
                            33..48,
                        ),
                        value: String(
                            "Asia/Shanghai",
                        ),
                    },
                ],
            ),
        },
    ),
    stmt: Query(
        Query {
            span: Some(
                50..58,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        50..58,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: Literal {
                                span: Some(
                                    57..58,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                            alias: None,
                        },
                    ],
                    from: [],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    ),
}


---------- Input ----------
SETTINGS (max_thread=1) select * from a anti join b on a.a = b.a;
---------- Output ---------
SETTINGS (max_thread = 1) SELECT * FROM a LEFT ANTI JOIN b ON a.a = b.a
---------- AST ------------
StatementWithSettings {
    settings: Some(
        Settings {
            set_type: SettingsQuery,
            identifiers: [
                Identifier {
                    span: Some(
                        10..20,
                    ),
                    name: "max_thread",
                    quote: None,
                    ident_type: None,
                },
            ],
            values: Expr(
                [
                    Literal {
                        span: Some(
                            21..22,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                ],
            ),
        },
    ),
    stmt: Query(
        Query {
            span: Some(
                24..64,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        24..64,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        StarColumns {
                            qualified: [
                                Star(
                                    Some(
                                        31..32,
                                    ),
                                ),
                            ],
                            column_filter: None,
                        },
                    ],
                    from: [
                        Join {
                            span: Some(
                                40..49,
                            ),
                            join: Join {
                                op: LeftAnti,
                                condition: On(
                                    BinaryOp {
                                        span: Some(
                                            59..60,
                                        ),
                                        op: Eq,
                                        left: ColumnRef {
                                            span: Some(
                                                55..56,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: Some(
                                                    Identifier {
                                                        span: Some(
                                                            55..56,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            57..58,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                        right: ColumnRef {
                                            span: Some(
                                                61..62,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: Some(
                                                    Identifier {
                                                        span: Some(
                                                            61..62,
                                                        ),
                                                        name: "b",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            63..64,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    },
                                ),
                                left: Table {
                                    span: Some(
                                        38..39,
                                    ),
                                    catalog: None,
                                    database: None,
                                    table: Identifier {
                                        span: Some(
                                            38..39,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    alias: None,
                                    temporal: None,
                                    with_options: None,
                                    pivot: None,
                                    unpivot: None,
                                    sample: None,
                                },
                                right: Table {
                                    span: Some(
                                        50..51,
                                    ),
                                    catalog: None,
                                    database: None,
                                    table: Identifier {
                                        span: Some(
                                            50..51,
                                        ),
                                        name: "b",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    alias: None,
                                    temporal: None,
                                    with_options: None,
                                    pivot: None,
                                    unpivot: None,
                                    sample: None,
                                },
                            },
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    ),
}


---------- Input ----------
select * from a right semi join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a RIGHT SEMI JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..46,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..46,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..31,
                        ),
                        join: Join {
                            op: RightSemi,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        41..42,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            37..38,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        37..38,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            43..44,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        43..44,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        45..46,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    32..33,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        32..33,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a right anti join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a RIGHT ANTI JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..46,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..46,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..31,
                        ),
                        join: Join {
                            op: RightAnti,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        41..42,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            37..38,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        37..38,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            43..44,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        43..44,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        45..46,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    32..33,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        32..33,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a full outer join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a FULL OUTER JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..46,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..46,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..31,
                        ),
                        join: Join {
                            op: FullOuter,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        41..42,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            37..38,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        37..38,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            43..44,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        43..44,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        45..46,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    32..33,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        32..33,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * FROM fuse_compat_table ignore_result;
---------- Output ---------
SELECT * FROM fuse_compat_table IGNORE_RESULT
---------- AST ------------
Query(
    Query {
        span: Some(
            0..31,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..31,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..31,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..31,
                            ),
                            name: "fuse_compat_table",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: true,
    },
)


---------- Input ----------
select * from a inner join b on a.a = b.a;
---------- Output ---------
SELECT * FROM a INNER JOIN b ON a.a = b.a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..41,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..41,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..26,
                        ),
                        join: Join {
                            op: Inner,
                            condition: On(
                                BinaryOp {
                                    span: Some(
                                        36..37,
                                    ),
                                    op: Eq,
                                    left: ColumnRef {
                                        span: Some(
                                            32..33,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        32..33,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        34..35,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    right: ColumnRef {
                                        span: Some(
                                            38..39,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: Some(
                                                Identifier {
                                                    span: Some(
                                                        38..39,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        40..41,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                },
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    27..28,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        27..28,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a left outer join b using(a);
---------- Output ---------
SELECT * FROM a LEFT OUTER JOIN b USING(a)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..42,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..42,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..31,
                        ),
                        join: Join {
                            op: LeftOuter,
                            condition: Using(
                                [
                                    Identifier {
                                        span: Some(
                                            40..41,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ],
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    32..33,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        32..33,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a right outer join b using(a);
---------- Output ---------
SELECT * FROM a RIGHT OUTER JOIN b USING(a)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..43,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..43,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..32,
                        ),
                        join: Join {
                            op: RightOuter,
                            condition: Using(
                                [
                                    Identifier {
                                        span: Some(
                                            41..42,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ],
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    33..34,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        33..34,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a full outer join b using(a);
---------- Output ---------
SELECT * FROM a FULL OUTER JOIN b USING(a)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..42,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..42,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..31,
                        ),
                        join: Join {
                            op: FullOuter,
                            condition: Using(
                                [
                                    Identifier {
                                        span: Some(
                                            40..41,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ],
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    32..33,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        32..33,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a inner join b using(a);
---------- Output ---------
SELECT * FROM a INNER JOIN b USING(a)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..37,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..37,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            16..26,
                        ),
                        join: Join {
                            op: Inner,
                            condition: Using(
                                [
                                    Identifier {
                                        span: Some(
                                            35..36,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ],
                            ),
                            left: Table {
                                span: Some(
                                    14..15,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        14..15,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                            right: Table {
                                span: Some(
                                    27..28,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        27..28,
                                    ),
                                    name: "b",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a where a.a = any (select b.a from b);
---------- Output ---------
SELECT * FROM a WHERE a.a = ANY (SELECT b.a FROM b)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..51,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..51,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            26..27,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                22..23,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            22..23,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            24..25,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Subquery {
                            span: Some(
                                28..51,
                            ),
                            modifier: Some(
                                Any,
                            ),
                            subquery: Query {
                                span: Some(
                                    33..50,
                                ),
                                with: None,
                                body: Select(
                                    SelectStmt {
                                        span: Some(
                                            33..50,
                                        ),
                                        hints: None,
                                        distinct: false,
                                        top_n: None,
                                        select_list: [
                                            AliasedExpr {
                                                expr: ColumnRef {
                                                    span: Some(
                                                        40..41,
                                                    ),
                                                    column: ColumnRef {
                                                        database: None,
                                                        table: Some(
                                                            Identifier {
                                                                span: Some(
                                                                    40..41,
                                                                ),
                                                                name: "b",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                        column: Name(
                                                            Identifier {
                                                                span: Some(
                                                                    42..43,
                                                                ),
                                                                name: "a",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                    },
                                                },
                                                alias: None,
                                            },
                                        ],
                                        from: [
                                            Table {
                                                span: Some(
                                                    49..50,
                                                ),
                                                catalog: None,
                                                database: None,
                                                table: Identifier {
                                                    span: Some(
                                                        49..50,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                                alias: None,
                                                temporal: None,
                                                with_options: None,
                                                pivot: None,
                                                unpivot: None,
                                                sample: None,
                                            },
                                        ],
                                        selection: None,
                                        group_by: None,
                                        having: None,
                                        window_list: None,
                                        qualify: None,
                                    },
                                ),
                                order_by: [],
                                limit: [],
                                offset: None,
                                ignore_result: false,
                            },
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a where a.a = all (select b.a from b);
---------- Output ---------
SELECT * FROM a WHERE a.a = ALL (SELECT b.a FROM b)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..51,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..51,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            26..27,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                22..23,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            22..23,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            24..25,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Subquery {
                            span: Some(
                                28..51,
                            ),
                            modifier: Some(
                                All,
                            ),
                            subquery: Query {
                                span: Some(
                                    33..50,
                                ),
                                with: None,
                                body: Select(
                                    SelectStmt {
                                        span: Some(
                                            33..50,
                                        ),
                                        hints: None,
                                        distinct: false,
                                        top_n: None,
                                        select_list: [
                                            AliasedExpr {
                                                expr: ColumnRef {
                                                    span: Some(
                                                        40..41,
                                                    ),
                                                    column: ColumnRef {
                                                        database: None,
                                                        table: Some(
                                                            Identifier {
                                                                span: Some(
                                                                    40..41,
                                                                ),
                                                                name: "b",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                        column: Name(
                                                            Identifier {
                                                                span: Some(
                                                                    42..43,
                                                                ),
                                                                name: "a",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                    },
                                                },
                                                alias: None,
                                            },
                                        ],
                                        from: [
                                            Table {
                                                span: Some(
                                                    49..50,
                                                ),
                                                catalog: None,
                                                database: None,
                                                table: Identifier {
                                                    span: Some(
                                                        49..50,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                                alias: None,
                                                temporal: None,
                                                with_options: None,
                                                pivot: None,
                                                unpivot: None,
                                                sample: None,
                                            },
                                        ],
                                        selection: None,
                                        group_by: None,
                                        having: None,
                                        window_list: None,
                                        qualify: None,
                                    },
                                ),
                                order_by: [],
                                limit: [],
                                offset: None,
                                ignore_result: false,
                            },
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a where a.a = some (select b.a from b);
---------- Output ---------
SELECT * FROM a WHERE a.a = SOME (SELECT b.a FROM b)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..52,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..52,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            26..27,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                22..23,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            22..23,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            24..25,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Subquery {
                            span: Some(
                                28..52,
                            ),
                            modifier: Some(
                                Some,
                            ),
                            subquery: Query {
                                span: Some(
                                    34..51,
                                ),
                                with: None,
                                body: Select(
                                    SelectStmt {
                                        span: Some(
                                            34..51,
                                        ),
                                        hints: None,
                                        distinct: false,
                                        top_n: None,
                                        select_list: [
                                            AliasedExpr {
                                                expr: ColumnRef {
                                                    span: Some(
                                                        41..42,
                                                    ),
                                                    column: ColumnRef {
                                                        database: None,
                                                        table: Some(
                                                            Identifier {
                                                                span: Some(
                                                                    41..42,
                                                                ),
                                                                name: "b",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                        column: Name(
                                                            Identifier {
                                                                span: Some(
                                                                    43..44,
                                                                ),
                                                                name: "a",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                    },
                                                },
                                                alias: None,
                                            },
                                        ],
                                        from: [
                                            Table {
                                                span: Some(
                                                    50..51,
                                                ),
                                                catalog: None,
                                                database: None,
                                                table: Identifier {
                                                    span: Some(
                                                        50..51,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                                alias: None,
                                                temporal: None,
                                                with_options: None,
                                                pivot: None,
                                                unpivot: None,
                                                sample: None,
                                            },
                                        ],
                                        selection: None,
                                        group_by: None,
                                        having: None,
                                        window_list: None,
                                        qualify: None,
                                    },
                                ),
                                order_by: [],
                                limit: [],
                                offset: None,
                                ignore_result: false,
                            },
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from a where a.a > (select b.a from b);
---------- Output ---------
SELECT * FROM a WHERE a.a > (SELECT b.a FROM b)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..47,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..47,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            26..27,
                        ),
                        op: Gt,
                        left: ColumnRef {
                            span: Some(
                                22..23,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            22..23,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            24..25,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Subquery {
                            span: Some(
                                28..47,
                            ),
                            modifier: None,
                            subquery: Query {
                                span: Some(
                                    29..46,
                                ),
                                with: None,
                                body: Select(
                                    SelectStmt {
                                        span: Some(
                                            29..46,
                                        ),
                                        hints: None,
                                        distinct: false,
                                        top_n: None,
                                        select_list: [
                                            AliasedExpr {
                                                expr: ColumnRef {
                                                    span: Some(
                                                        36..37,
                                                    ),
                                                    column: ColumnRef {
                                                        database: None,
                                                        table: Some(
                                                            Identifier {
                                                                span: Some(
                                                                    36..37,
                                                                ),
                                                                name: "b",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                        column: Name(
                                                            Identifier {
                                                                span: Some(
                                                                    38..39,
                                                                ),
                                                                name: "a",
                                                                quote: None,
                                                                ident_type: None,
                                                            },
                                                        ),
                                                    },
                                                },
                                                alias: None,
                                            },
                                        ],
                                        from: [
                                            Table {
                                                span: Some(
                                                    45..46,
                                                ),
                                                catalog: None,
                                                database: None,
                                                table: Identifier {
                                                    span: Some(
                                                        45..46,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                                alias: None,
                                                temporal: None,
                                                with_options: None,
                                                pivot: None,
                                                unpivot: None,
                                                sample: None,
                                            },
                                        ],
                                        selection: None,
                                        group_by: None,
                                        having: None,
                                        window_list: None,
                                        qualify: None,
                                    },
                                ),
                                order_by: [],
                                limit: [],
                                offset: None,
                                ignore_result: false,
                            },
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select 1 from numbers(1) where ((1 = 1) or 1)
---------- Output ---------
SELECT 1 FROM numbers(1) WHERE 1 = 1 OR 1
---------- AST ------------
Query(
    Query {
        span: Some(
            0..45,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..45,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                7..8,
                            ),
                            value: UInt64(
                                1,
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..24,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..21,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    22..23,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            40..42,
                        ),
                        op: Or,
                        left: BinaryOp {
                            span: Some(
                                35..36,
                            ),
                            op: Eq,
                            left: Literal {
                                span: Some(
                                    33..34,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                            right: Literal {
                                span: Some(
                                    37..38,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                43..44,
                            ),
                            value: UInt64(
                                1,
                            ),
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from read_parquet('p1', 'p2', 'p3', prune_page => true, refresh_meta_cache => true);
---------- Output ---------
SELECT * FROM read_parquet('p1', 'p2', 'p3',prune_page=>TRUE,refresh_meta_cache=>TRUE)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..92,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..92,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..92,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..26,
                            ),
                            name: "read_parquet",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    27..31,
                                ),
                                value: String(
                                    "p1",
                                ),
                            },
                            Literal {
                                span: Some(
                                    33..37,
                                ),
                                value: String(
                                    "p2",
                                ),
                            },
                            Literal {
                                span: Some(
                                    39..43,
                                ),
                                value: String(
                                    "p3",
                                ),
                            },
                        ],
                        named_params: [
                            (
                                Identifier {
                                    span: Some(
                                        45..55,
                                    ),
                                    name: "prune_page",
                                    quote: None,
                                    ident_type: None,
                                },
                                Literal {
                                    span: Some(
                                        59..63,
                                    ),
                                    value: Boolean(
                                        true,
                                    ),
                                },
                            ),
                            (
                                Identifier {
                                    span: Some(
                                        65..83,
                                    ),
                                    name: "refresh_meta_cache",
                                    quote: None,
                                    ident_type: None,
                                },
                                Literal {
                                    span: Some(
                                        87..91,
                                    ),
                                    value: Boolean(
                                        true,
                                    ),
                                },
                            ),
                        ],
                        alias: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from @foo (pattern=>'[.]*parquet' file_format=>'tsv');
---------- Output ---------
SELECT * FROM '@foo' ( FILE_FORMAT => 'tsv', PATTERN => '[.]*parquet', )
---------- AST ------------
Query(
    Query {
        span: Some(
            0..62,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..62,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Location {
                        span: Some(
                            14..62,
                        ),
                        location: Stage(
                            "foo",
                        ),
                        options: SelectStageOptions {
                            files: None,
                            pattern: Some(
                                Literal(
                                    "[.]*parquet",
                                ),
                            ),
                            file_format: Some(
                                "tsv",
                            ),
                            connection: {},
                            case_sensitive: None,
                        },
                        alias: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select 'stringwith''quote'''
---------- Output ---------
SELECT 'stringwith\'quote\''
---------- AST ------------
Query(
    Query {
        span: Some(
            0..28,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..28,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                7..28,
                            ),
                            value: String(
                                "stringwith'quote'",
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select 'stringwith"doublequote'
---------- Output ---------
SELECT 'stringwith"doublequote'
---------- AST ------------
Query(
    Query {
        span: Some(
            0..31,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..31,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                7..31,
                            ),
                            value: String(
                                "stringwith\"doublequote",
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select '🦈'
---------- Output ---------
SELECT '🦈'
---------- AST ------------
Query(
    Query {
        span: Some(
            0..13,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..13,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                7..13,
                            ),
                            value: String(
                                "🦈",
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * FROM t where ((a));
---------- Output ---------
SELECT * FROM t WHERE a
---------- AST ------------
Query(
    Query {
        span: Some(
            0..27,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..27,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    ColumnRef {
                        span: Some(
                            24..25,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        24..25,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * FROM t where ((select 1) > 1);
---------- Output ---------
SELECT * FROM t WHERE (SELECT 1) > 1
---------- AST ------------
Query(
    Query {
        span: Some(
            0..38,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..38,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            34..35,
                        ),
                        op: Gt,
                        left: Subquery {
                            span: Some(
                                23..33,
                            ),
                            modifier: None,
                            subquery: Query {
                                span: Some(
                                    24..32,
                                ),
                                with: None,
                                body: Select(
                                    SelectStmt {
                                        span: Some(
                                            24..32,
                                        ),
                                        hints: None,
                                        distinct: false,
                                        top_n: None,
                                        select_list: [
                                            AliasedExpr {
                                                expr: Literal {
                                                    span: Some(
                                                        31..32,
                                                    ),
                                                    value: UInt64(
                                                        1,
                                                    ),
                                                },
                                                alias: None,
                                            },
                                        ],
                                        from: [],
                                        selection: None,
                                        group_by: None,
                                        having: None,
                                        window_list: None,
                                        qualify: None,
                                    },
                                ),
                                order_by: [],
                                limit: [],
                                offset: None,
                                ignore_result: false,
                            },
                        },
                        right: Literal {
                            span: Some(
                                36..37,
                            ),
                            value: UInt64(
                                1,
                            ),
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select ((t1.a)>=(((((t2.b)<=(t3.c))) IS NOT NULL)::INTEGER));
---------- Output ---------
SELECT t1.a >= (t2.b <= t3.c IS NOT NULL)::Int32
---------- AST ------------
Query(
    Query {
        span: Some(
            0..60,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..60,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: BinaryOp {
                            span: Some(
                                14..16,
                            ),
                            op: Gte,
                            left: ColumnRef {
                                span: Some(
                                    9..11,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: Some(
                                        Identifier {
                                            span: Some(
                                                9..11,
                                            ),
                                            name: "t1",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                12..13,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            right: Cast {
                                span: Some(
                                    49..58,
                                ),
                                expr: IsNull {
                                    span: Some(
                                        37..48,
                                    ),
                                    expr: BinaryOp {
                                        span: Some(
                                            26..28,
                                        ),
                                        op: Lte,
                                        left: ColumnRef {
                                            span: Some(
                                                21..23,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: Some(
                                                    Identifier {
                                                        span: Some(
                                                            21..23,
                                                        ),
                                                        name: "t2",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            24..25,
                                                        ),
                                                        name: "b",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                        right: ColumnRef {
                                            span: Some(
                                                29..31,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: Some(
                                                    Identifier {
                                                        span: Some(
                                                            29..31,
                                                        ),
                                                        name: "t3",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            32..33,
                                                        ),
                                                        name: "c",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    },
                                    not: true,
                                },
                                target_type: Int32,
                                pg_style: true,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select 33 as row, abc(33, row), def(row)
---------- Output ---------
SELECT 33 AS row, abc(33, row), def(row)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..40,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..40,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                7..9,
                            ),
                            value: UInt64(
                                33,
                            ),
                        },
                        alias: Some(
                            Identifier {
                                span: Some(
                                    13..16,
                                ),
                                name: "row",
                                quote: None,
                                ident_type: None,
                            },
                        ),
                    },
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                18..30,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        18..21,
                                    ),
                                    name: "abc",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    Literal {
                                        span: Some(
                                            22..24,
                                        ),
                                        value: UInt64(
                                            33,
                                        ),
                                    },
                                    ColumnRef {
                                        span: Some(
                                            26..29,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        26..29,
                                                    ),
                                                    name: "row",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                32..40,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        32..35,
                                    ),
                                    name: "def",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            36..39,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        36..39,
                                                    ),
                                                    name: "row",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT func(ROW) FROM (SELECT 1 as ROW) t
---------- Output ---------
SELECT func(row) FROM (SELECT 1 AS ROW) AS t
---------- AST ------------
Query(
    Query {
        span: Some(
            0..41,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..41,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..16,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..11,
                                    ),
                                    name: "func",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            12..15,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        12..15,
                                                    ),
                                                    name: "row",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Subquery {
                        span: Some(
                            22..41,
                        ),
                        lateral: false,
                        subquery: Query {
                            span: Some(
                                23..38,
                            ),
                            with: None,
                            body: Select(
                                SelectStmt {
                                    span: Some(
                                        23..38,
                                    ),
                                    hints: None,
                                    distinct: false,
                                    top_n: None,
                                    select_list: [
                                        AliasedExpr {
                                            expr: Literal {
                                                span: Some(
                                                    30..31,
                                                ),
                                                value: UInt64(
                                                    1,
                                                ),
                                            },
                                            alias: Some(
                                                Identifier {
                                                    span: Some(
                                                        35..38,
                                                    ),
                                                    name: "ROW",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    ],
                                    from: [],
                                    selection: None,
                                    group_by: None,
                                    having: None,
                                    window_list: None,
                                    qualify: None,
                                },
                            ),
                            order_by: [],
                            limit: [],
                            offset: None,
                            ignore_result: false,
                        },
                        alias: Some(
                            TableAlias {
                                name: Identifier {
                                    span: Some(
                                        40..41,
                                    ),
                                    name: "t",
                                    quote: None,
                                    ident_type: None,
                                },
                                columns: [],
                            },
                        ),
                        pivot: None,
                        unpivot: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from t sample row (99);
---------- Output ---------
SELECT * FROM t SAMPLE ROW (99)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..31,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..31,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..31,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: Some(
                            SampleConfig {
                                row_level: Some(
                                    Probability(
                                        99.0,
                                    ),
                                ),
                                block_level: None,
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from t sample block (99);
---------- Output ---------
SELECT * FROM t SAMPLE BLOCK (99) 
---------- AST ------------
Query(
    Query {
        span: Some(
            0..33,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..33,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..33,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: Some(
                            SampleConfig {
                                row_level: None,
                                block_level: Some(
                                    99.0,
                                ),
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from t sample row (10 rows);
---------- Output ---------
SELECT * FROM t SAMPLE ROW (10 ROWS)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..36,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..36,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..36,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: Some(
                            SampleConfig {
                                row_level: Some(
                                    RowsNum(
                                        10.0,
                                    ),
                                ),
                                block_level: None,
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from numbers(1000) sample row (99);
---------- Output ---------
SELECT * FROM numbers(1000) SAMPLE ROW (99)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..43,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..43,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..43,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..21,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    22..26,
                                ),
                                value: UInt64(
                                    1000,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: Some(
                            SampleConfig {
                                row_level: Some(
                                    Probability(
                                        99.0,
                                    ),
                                ),
                                block_level: None,
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from numbers(1000) sample block (99);
---------- Output ---------
SELECT * FROM numbers(1000) SAMPLE BLOCK (99) 
---------- AST ------------
Query(
    Query {
        span: Some(
            0..45,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..45,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..45,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..21,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    22..26,
                                ),
                                value: UInt64(
                                    1000,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: Some(
                            SampleConfig {
                                row_level: None,
                                block_level: Some(
                                    99.0,
                                ),
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from numbers(1000) sample row (10 rows);
---------- Output ---------
SELECT * FROM numbers(1000) SAMPLE ROW (10 ROWS)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..48,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..48,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..48,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..21,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    22..26,
                                ),
                                value: UInt64(
                                    1000,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: Some(
                            SampleConfig {
                                row_level: Some(
                                    RowsNum(
                                        10.0,
                                    ),
                                ),
                                block_level: None,
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from numbers(1000) sample block (99) row (10 rows);
---------- Output ---------
SELECT * FROM numbers(1000) SAMPLE BLOCK (99) ROW (10 ROWS)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..59,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..59,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..59,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..21,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    22..26,
                                ),
                                value: UInt64(
                                    1000,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: Some(
                            SampleConfig {
                                row_level: Some(
                                    RowsNum(
                                        10.0,
                                    ),
                                ),
                                block_level: Some(
                                    99.0,
                                ),
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select * from numbers(1000) sample block (99) row (10);
---------- Output ---------
SELECT * FROM numbers(1000) SAMPLE BLOCK (99) ROW (10)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..54,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..54,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            14..54,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                14..21,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    22..26,
                                ),
                                value: UInt64(
                                    1000,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: Some(
                            SampleConfig {
                                row_level: Some(
                                    Probability(
                                        10.0,
                                    ),
                                ),
                                block_level: Some(
                                    99.0,
                                ),
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
insert into t (c1, c2) values (1, 2), (3, 4);
---------- Output ---------
INSERT INTO t (c1, c2) VALUES (1, 2), (3, 4)
---------- AST ------------
Insert(
    InsertStmt {
        hints: None,
        with: None,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                12..13,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    15..17,
                ),
                name: "c1",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    19..21,
                ),
                name: "c2",
                quote: None,
                ident_type: None,
            },
        ],
        source: Values {
            rows: [
                [
                    Literal {
                        span: Some(
                            31..32,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                    Literal {
                        span: Some(
                            34..35,
                        ),
                        value: UInt64(
                            2,
                        ),
                    },
                ],
                [
                    Literal {
                        span: Some(
                            39..40,
                        ),
                        value: UInt64(
                            3,
                        ),
                    },
                    Literal {
                        span: Some(
                            42..43,
                        ),
                        value: UInt64(
                            4,
                        ),
                    },
                ],
            ],
        },
        overwrite: false,
    },
)


---------- Input ----------
insert into t (c1, c2) values (1, 2);
---------- Output ---------
INSERT INTO t (c1, c2) VALUES (1, 2)
---------- AST ------------
Insert(
    InsertStmt {
        hints: None,
        with: None,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                12..13,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        columns: [
            Identifier {
                span: Some(
                    15..17,
                ),
                name: "c1",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    19..21,
                ),
                name: "c2",
                quote: None,
                ident_type: None,
            },
        ],
        source: Values {
            rows: [
                [
                    Literal {
                        span: Some(
                            31..32,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                    Literal {
                        span: Some(
                            34..35,
                        ),
                        value: UInt64(
                            2,
                        ),
                    },
                ],
            ],
        },
        overwrite: false,
    },
)


---------- Input ----------
insert into table t select * from t2;
---------- Output ---------
INSERT INTO t SELECT * FROM t2
---------- AST ------------
Insert(
    InsertStmt {
        hints: None,
        with: None,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                18..19,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        columns: [],
        source: Select {
            query: Query {
                span: Some(
                    20..36,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            20..36,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            StarColumns {
                                qualified: [
                                    Star(
                                        Some(
                                            27..28,
                                        ),
                                    ),
                                ],
                                column_filter: None,
                            },
                        ],
                        from: [
                            Table {
                                span: Some(
                                    34..36,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        34..36,
                                    ),
                                    name: "t2",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        ],
                        selection: None,
                        group_by: None,
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [],
                offset: None,
                ignore_result: false,
            },
        },
        overwrite: false,
    },
)


---------- Input ----------
insert overwrite into table t select * from t2;
---------- Output ---------
INSERT OVERWRITE t SELECT * FROM t2
---------- AST ------------
Insert(
    InsertStmt {
        hints: None,
        with: None,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                28..29,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        columns: [],
        source: Select {
            query: Query {
                span: Some(
                    30..46,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            30..46,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            StarColumns {
                                qualified: [
                                    Star(
                                        Some(
                                            37..38,
                                        ),
                                    ),
                                ],
                                column_filter: None,
                            },
                        ],
                        from: [
                            Table {
                                span: Some(
                                    44..46,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        44..46,
                                    ),
                                    name: "t2",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        ],
                        selection: None,
                        group_by: None,
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [],
                offset: None,
                ignore_result: false,
            },
        },
        overwrite: true,
    },
)


---------- Input ----------
insert overwrite table t select * from t2;
---------- Output ---------
INSERT OVERWRITE t SELECT * FROM t2
---------- AST ------------
Insert(
    InsertStmt {
        hints: None,
        with: None,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                23..24,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        columns: [],
        source: Select {
            query: Query {
                span: Some(
                    25..41,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            25..41,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            StarColumns {
                                qualified: [
                                    Star(
                                        Some(
                                            32..33,
                                        ),
                                    ),
                                ],
                                column_filter: None,
                            },
                        ],
                        from: [
                            Table {
                                span: Some(
                                    39..41,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        39..41,
                                    ),
                                    name: "t2",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        ],
                        selection: None,
                        group_by: None,
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [],
                offset: None,
                ignore_result: false,
            },
        },
        overwrite: true,
    },
)


---------- Input ----------
INSERT ALL
    WHEN c3 = 1 THEN
      INTO t1
    WHEN c3 = 3 THEN
      INTO t2
SELECT * from s;
---------- Output ---------
INSERT ALL WHEN c3 = 1 THEN INTO t1  WHEN c3 = 3 THEN INTO t2  SELECT * FROM s
---------- AST ------------
InsertMultiTable(
    InsertMultiTableStmt {
        overwrite: false,
        is_first: false,
        when_clauses: [
            WhenClause {
                condition: BinaryOp {
                    span: Some(
                        23..24,
                    ),
                    op: Eq,
                    left: ColumnRef {
                        span: Some(
                            20..22,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        20..22,
                                    ),
                                    name: "c3",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            25..26,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                },
                into_clauses: [
                    IntoClause {
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                43..45,
                            ),
                            name: "t1",
                            quote: None,
                            ident_type: None,
                        },
                        target_columns: [],
                        source_columns: [],
                    },
                ],
            },
            WhenClause {
                condition: BinaryOp {
                    span: Some(
                        58..59,
                    ),
                    op: Eq,
                    left: ColumnRef {
                        span: Some(
                            55..57,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        55..57,
                                    ),
                                    name: "c3",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            60..61,
                        ),
                        value: UInt64(
                            3,
                        ),
                    },
                },
                into_clauses: [
                    IntoClause {
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                78..80,
                            ),
                            name: "t2",
                            quote: None,
                            ident_type: None,
                        },
                        target_columns: [],
                        source_columns: [],
                    },
                ],
            },
        ],
        else_clause: None,
        into_clauses: [],
        source: Query {
            span: Some(
                81..96,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        81..96,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        StarColumns {
                            qualified: [
                                Star(
                                    Some(
                                        88..89,
                                    ),
                                ),
                            ],
                            column_filter: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                95..96,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    95..96,
                                ),
                                name: "s",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
INSERT overwrite ALL
    WHEN c3 = 1 THEN
      INTO t1
    WHEN c3 = 3 THEN
      INTO t2
SELECT * from s;
---------- Output ---------
INSERT OVERWRITE ALL WHEN c3 = 1 THEN INTO t1  WHEN c3 = 3 THEN INTO t2  SELECT * FROM s
---------- AST ------------
InsertMultiTable(
    InsertMultiTableStmt {
        overwrite: true,
        is_first: false,
        when_clauses: [
            WhenClause {
                condition: BinaryOp {
                    span: Some(
                        33..34,
                    ),
                    op: Eq,
                    left: ColumnRef {
                        span: Some(
                            30..32,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        30..32,
                                    ),
                                    name: "c3",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            35..36,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                },
                into_clauses: [
                    IntoClause {
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                53..55,
                            ),
                            name: "t1",
                            quote: None,
                            ident_type: None,
                        },
                        target_columns: [],
                        source_columns: [],
                    },
                ],
            },
            WhenClause {
                condition: BinaryOp {
                    span: Some(
                        68..69,
                    ),
                    op: Eq,
                    left: ColumnRef {
                        span: Some(
                            65..67,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        65..67,
                                    ),
                                    name: "c3",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            70..71,
                        ),
                        value: UInt64(
                            3,
                        ),
                    },
                },
                into_clauses: [
                    IntoClause {
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                88..90,
                            ),
                            name: "t2",
                            quote: None,
                            ident_type: None,
                        },
                        target_columns: [],
                        source_columns: [],
                    },
                ],
            },
        ],
        else_clause: None,
        into_clauses: [],
        source: Query {
            span: Some(
                91..106,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        91..106,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        StarColumns {
                            qualified: [
                                Star(
                                    Some(
                                        98..99,
                                    ),
                                ),
                            ],
                            column_filter: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                105..106,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    105..106,
                                ),
                                name: "s",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
select parse_json('{"k1": [0, 1, 2]}').k1[0];
---------- Output ---------
SELECT parse_json('{"k1": [0, 1, 2]}'):k1[0]
---------- AST ------------
Query(
    Query {
        span: Some(
            0..44,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..44,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: MapAccess {
                            span: Some(
                                41..44,
                            ),
                            expr: MapAccess {
                                span: Some(
                                    38..41,
                                ),
                                expr: FunctionCall {
                                    span: Some(
                                        7..38,
                                    ),
                                    func: FunctionCall {
                                        distinct: false,
                                        name: Identifier {
                                            span: Some(
                                                7..17,
                                            ),
                                            name: "parse_json",
                                            quote: None,
                                            ident_type: None,
                                        },
                                        args: [
                                            Literal {
                                                span: Some(
                                                    18..37,
                                                ),
                                                value: String(
                                                    "{\"k1\": [0, 1, 2]}",
                                                ),
                                            },
                                        ],
                                        params: [],
                                        order_by: [],
                                        window: None,
                                        lambda: None,
                                    },
                                },
                                accessor: Colon {
                                    key: Identifier {
                                        span: Some(
                                            39..41,
                                        ),
                                        name: "k1",
                                        quote: None,
                                        ident_type: None,
                                    },
                                },
                            },
                            accessor: Bracket {
                                key: Literal {
                                    span: Some(
                                        42..43,
                                    ),
                                    value: UInt64(
                                        0,
                                    ),
                                },
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT avg((number > 314)::UInt32);
---------- Output ---------
SELECT avg((number > 314)::UInt32)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..34,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..34,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..34,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..10,
                                    ),
                                    name: "avg",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    Cast {
                                        span: Some(
                                            25..33,
                                        ),
                                        expr: BinaryOp {
                                            span: Some(
                                                19..20,
                                            ),
                                            op: Gt,
                                            left: ColumnRef {
                                                span: Some(
                                                    12..18,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                12..18,
                                                            ),
                                                            name: "number",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            right: Literal {
                                                span: Some(
                                                    21..24,
                                                ),
                                                value: UInt64(
                                                    314,
                                                ),
                                            },
                                        },
                                        target_type: UInt32,
                                        pg_style: true,
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT 1 - (2 + 3);
---------- Output ---------
SELECT 1 - (2 + 3)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..18,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..18,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: BinaryOp {
                            span: Some(
                                9..10,
                            ),
                            op: Minus,
                            left: Literal {
                                span: Some(
                                    7..8,
                                ),
                                value: UInt64(
                                    1,
                                ),
                            },
                            right: BinaryOp {
                                span: Some(
                                    14..15,
                                ),
                                op: Plus,
                                left: Literal {
                                    span: Some(
                                        12..13,
                                    ),
                                    value: UInt64(
                                        2,
                                    ),
                                },
                                right: Literal {
                                    span: Some(
                                        16..17,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
CREATE STAGE ~
---------- Output ---------
CREATE STAGE ~
---------- AST ------------
CreateStage(
    CreateStageStmt {
        create_option: Create,
        stage_name: "~",
        location: None,
        file_format_options: FileFormatOptions {
            options: {},
        },
        comments: "",
    },
)


---------- Input ----------
CREATE STAGE IF NOT EXISTS test_stage 's3://load/files/' connection=(aws_key_id='1a2b3c', aws_secret_key='4x5y6z') file_format=(type = CSV, compression = GZIP record_delimiter=',')
---------- Output ---------
CREATE STAGE IF NOT EXISTS test_stage 's3://load/files/' CONNECTION = ( aws_key_id = '1a2b3c', aws_secret_key = '4x5y6z' ) FILE_FORMAT = (compression = GZIP, record_delimiter = ',', type = CSV)
---------- AST ------------
CreateStage(
    CreateStageStmt {
        create_option: CreateIfNotExists,
        stage_name: "test_stage",
        location: Some(
            UriLocation {
                protocol: "s3",
                name: "load",
                path: "/files/",
                connection: Connection {
                    visited_keys: {},
                    conns: {
                        "aws_key_id": "1a2b3c",
                        "aws_secret_key": "4x5y6z",
                    },
                },
            },
        ),
        file_format_options: FileFormatOptions {
            options: {
                "compression": Keyword(
                    "GZIP",
                ),
                "record_delimiter": String(
                    ",",
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        comments: "",
    },
)


---------- Input ----------
CREATE STAGE IF NOT EXISTS test_stage url='s3://load/files/' connection=(aws_key_id='1a2b3c', aws_secret_key='4x5y6z') file_format=(type = CSV, compression = GZIP record_delimiter=',')
---------- Output ---------
CREATE STAGE IF NOT EXISTS test_stage 's3://load/files/' CONNECTION = ( aws_key_id = '1a2b3c', aws_secret_key = '4x5y6z' ) FILE_FORMAT = (compression = GZIP, record_delimiter = ',', type = CSV)
---------- AST ------------
CreateStage(
    CreateStageStmt {
        create_option: CreateIfNotExists,
        stage_name: "test_stage",
        location: Some(
            UriLocation {
                protocol: "s3",
                name: "load",
                path: "/files/",
                connection: Connection {
                    visited_keys: {},
                    conns: {
                        "aws_key_id": "1a2b3c",
                        "aws_secret_key": "4x5y6z",
                    },
                },
            },
        ),
        file_format_options: FileFormatOptions {
            options: {
                "compression": Keyword(
                    "GZIP",
                ),
                "record_delimiter": String(
                    ",",
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        comments: "",
    },
)


---------- Input ----------
CREATE STAGE IF NOT EXISTS test_stage url='azblob://load/files/' connection=(account_name='1a2b3c' account_key='4x5y6z') file_format=(type = CSV compression = GZIP record_delimiter=',')
---------- Output ---------
CREATE STAGE IF NOT EXISTS test_stage 'azblob://load/files/' CONNECTION = ( account_key = '4x5y6z', account_name = '1a2b3c' ) FILE_FORMAT = (compression = GZIP, record_delimiter = ',', type = CSV)
---------- AST ------------
CreateStage(
    CreateStageStmt {
        create_option: CreateIfNotExists,
        stage_name: "test_stage",
        location: Some(
            UriLocation {
                protocol: "azblob",
                name: "load",
                path: "/files/",
                connection: Connection {
                    visited_keys: {},
                    conns: {
                        "account_key": "4x5y6z",
                        "account_name": "1a2b3c",
                    },
                },
            },
        ),
        file_format_options: FileFormatOptions {
            options: {
                "compression": Keyword(
                    "GZIP",
                ),
                "record_delimiter": String(
                    ",",
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        comments: "",
    },
)


---------- Input ----------
CREATE OR REPLACE STAGE test_stage url='azblob://load/files/' connection=(account_name='1a2b3c' account_key='4x5y6z') file_format=(type = CSV compression = GZIP record_delimiter=',')
---------- Output ---------
CREATE OR REPLACE STAGE test_stage 'azblob://load/files/' CONNECTION = ( account_key = '4x5y6z', account_name = '1a2b3c' ) FILE_FORMAT = (compression = GZIP, record_delimiter = ',', type = CSV)
---------- AST ------------
CreateStage(
    CreateStageStmt {
        create_option: CreateOrReplace,
        stage_name: "test_stage",
        location: Some(
            UriLocation {
                protocol: "azblob",
                name: "load",
                path: "/files/",
                connection: Connection {
                    visited_keys: {},
                    conns: {
                        "account_key": "4x5y6z",
                        "account_name": "1a2b3c",
                    },
                },
            },
        ),
        file_format_options: FileFormatOptions {
            options: {
                "compression": Keyword(
                    "GZIP",
                ),
                "record_delimiter": String(
                    ",",
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        comments: "",
    },
)


---------- Input ----------
DROP STAGE abc
---------- Output ---------
DROP STAGE abc
---------- AST ------------
DropStage {
    if_exists: false,
    stage_name: "abc",
}


---------- Input ----------
DROP STAGE ~
---------- Output ---------
DROP STAGE ~
---------- AST ------------
DropStage {
    if_exists: false,
    stage_name: "~",
}


---------- Input ----------
list @stage_a;
---------- Output ---------
LIST @stage_a
---------- AST ------------
ListStage {
    location: "stage_a",
    pattern: None,
}


---------- Input ----------
list @~;
---------- Output ---------
LIST @~
---------- AST ------------
ListStage {
    location: "~",
    pattern: None,
}


---------- Input ----------
create user 'test-e' identified by 'password';
---------- Output ---------
CREATE USER 'test-e'@'%' IDENTIFIED BY 'password'
---------- AST ------------
CreateUser(
    CreateUserStmt {
        create_option: Create,
        user: UserIdentity {
            username: "test-e",
            hostname: "%",
        },
        auth_option: AuthOption {
            auth_type: None,
            password: Some(
                "password",
            ),
        },
        user_options: [],
    },
)


---------- Input ----------
drop user if exists 'test-j';
---------- Output ---------
DROP USER IF EXISTS 'test-j'@'%'
---------- AST ------------
DropUser {
    if_exists: true,
    user: UserIdentity {
        username: "test-j",
        hostname: "%",
    },
}


---------- Input ----------
alter user 'test-e' identified by 'new-password';
---------- Output ---------
ALTER USER 'test-e'@'%' IDENTIFIED BY 'new-password'
---------- AST ------------
AlterUser(
    AlterUserStmt {
        user: Some(
            UserIdentity {
                username: "test-e",
                hostname: "%",
            },
        ),
        auth_option: Some(
            AuthOption {
                auth_type: None,
                password: Some(
                    "new-password",
                ),
            },
        ),
        user_options: [],
    },
)


---------- Input ----------
create role test
---------- Output ---------
CREATE ROLE 'test'
---------- AST ------------
CreateRole {
    create_option: Create,
    role_name: "test",
    comment: None,
}


---------- Input ----------
create role 'test'
---------- Output ---------
CREATE ROLE 'test'
---------- AST ------------
CreateRole {
    create_option: Create,
    role_name: "test",
    comment: None,
}


---------- Input ----------
create user `a'a` identified by '123'
---------- Output ---------
CREATE USER 'a\'a'@'%' IDENTIFIED BY '123'
---------- AST ------------
CreateUser(
    CreateUserStmt {
        create_option: Create,
        user: UserIdentity {
            username: "a'a",
            hostname: "%",
        },
        auth_option: AuthOption {
            auth_type: None,
            password: Some(
                "123",
            ),
        },
        user_options: [],
    },
)


---------- Input ----------
drop role if exists test
---------- Output ---------
DROP ROLE IF EXISTS 'test'
---------- AST ------------
DropRole {
    if_exists: true,
    role_name: "test",
}


---------- Input ----------
drop role if exists 'test'
---------- Output ---------
DROP ROLE IF EXISTS 'test'
---------- AST ------------
DropRole {
    if_exists: true,
    role_name: "test",
}


---------- Input ----------
OPTIMIZE TABLE t COMPACT SEGMENT LIMIT 10;
---------- Output ---------
OPTIMIZE TABLE t COMPACT SEGMENT LIMIT 10
---------- AST ------------
OptimizeTable(
    OptimizeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        action: Compact {
            target: Segment,
        },
        limit: Some(
            10,
        ),
    },
)


---------- Input ----------
OPTIMIZE TABLE t COMPACT LIMIT 10;
---------- Output ---------
OPTIMIZE TABLE t COMPACT LIMIT 10
---------- AST ------------
OptimizeTable(
    OptimizeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        action: Compact {
            target: Block,
        },
        limit: Some(
            10,
        ),
    },
)


---------- Input ----------
OPTIMIZE TABLE t PURGE BEFORE (SNAPSHOT => '9828b23f74664ff3806f44bbc1925ea5') LIMIT 10;
---------- Output ---------
OPTIMIZE TABLE t PURGE BEFORE (SNAPSHOT => '9828b23f74664ff3806f44bbc1925ea5') LIMIT 10
---------- AST ------------
OptimizeTable(
    OptimizeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        action: Purge {
            before: Some(
                Snapshot(
                    "9828b23f74664ff3806f44bbc1925ea5",
                ),
            ),
        },
        limit: Some(
            10,
        ),
    },
)


---------- Input ----------
OPTIMIZE TABLE t PURGE BEFORE (TIMESTAMP => '2023-06-26 09:49:02.038483'::TIMESTAMP) LIMIT 10;
---------- Output ---------
OPTIMIZE TABLE t PURGE BEFORE (TIMESTAMP => '2023-06-26 09:49:02.038483'::TIMESTAMP) LIMIT 10
---------- AST ------------
OptimizeTable(
    OptimizeTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                15..16,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        action: Purge {
            before: Some(
                Timestamp(
                    Cast {
                        span: Some(
                            72..83,
                        ),
                        expr: Literal {
                            span: Some(
                                44..72,
                            ),
                            value: String(
                                "2023-06-26 09:49:02.038483",
                            ),
                        },
                        target_type: Timestamp,
                        pg_style: true,
                    },
                ),
            ),
        },
        limit: Some(
            10,
        ),
    },
)


---------- Input ----------
ALTER TABLE t CLUSTER BY(c1);
---------- Output ---------
ALTER TABLE t CLUSTER BY LINEAR(c1)
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AlterTableClusterKey {
            cluster_by: ClusterOption {
                cluster_type: Linear,
                cluster_exprs: [
                    ColumnRef {
                        span: Some(
                            25..27,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        25..27,
                                    ),
                                    name: "c1",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ],
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t1 swap with t2;
---------- Output ---------
ALTER TABLE t1 SWAP WITH t2
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..14,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..14,
                ),
                name: "t1",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: SwapWith {
            target_table: Identifier {
                span: Some(
                    25..27,
                ),
                name: "t2",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t refresh cache;
---------- Output ---------
ALTER TABLE t REFRESH CACHE
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: RefreshTableCache,
    },
)


---------- Input ----------
ALTER TABLE t COMMENT='t1-commnet';
---------- Output ---------
ALTER TABLE t COMMENT='t1-commnet'
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyTableComment {
            new_comment: "t1-commnet",
        },
    },
)


---------- Input ----------
ALTER TABLE t DROP CLUSTER KEY;
---------- Output ---------
ALTER TABLE t DROP CLUSTER KEY
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: DropTableClusterKey,
    },
)


---------- Input ----------
ALTER TABLE t RECLUSTER FINAL WHERE c1 > 0 LIMIT 10;
---------- Output ---------
ALTER TABLE t RECLUSTER FINAL WHERE c1 > 0 LIMIT 10
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ReclusterTable {
            is_final: true,
            selection: Some(
                BinaryOp {
                    span: Some(
                        39..40,
                    ),
                    op: Gt,
                    left: ColumnRef {
                        span: Some(
                            36..38,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        36..38,
                                    ),
                                    name: "c1",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            41..42,
                        ),
                        value: UInt64(
                            0,
                        ),
                    },
                },
            ),
            limit: Some(
                10,
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD c int null;
---------- Output ---------
ALTER TABLE t ADD COLUMN c Int32 NULL
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddColumn {
            column: ColumnDefinition {
                name: Identifier {
                    span: Some(
                        18..19,
                    ),
                    name: "c",
                    quote: None,
                    ident_type: None,
                },
                data_type: Nullable(
                    Int32,
                ),
                expr: None,
                check: None,
                comment: None,
            },
            option: End,
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD COLUMN c int null;
---------- Output ---------
ALTER TABLE t ADD COLUMN c Int32 NULL
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddColumn {
            column: ColumnDefinition {
                name: Identifier {
                    span: Some(
                        25..26,
                    ),
                    name: "c",
                    quote: None,
                    ident_type: None,
                },
                data_type: Nullable(
                    Int32,
                ),
                expr: None,
                check: None,
                comment: None,
            },
            option: End,
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD COLUMN a float default 1.1 COMMENT 'hello' FIRST;
---------- Output ---------
ALTER TABLE t ADD COLUMN a Float32 DEFAULT 1.1 COMMENT 'hello' FIRST
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddColumn {
            column: ColumnDefinition {
                name: Identifier {
                    span: Some(
                        25..26,
                    ),
                    name: "a",
                    quote: None,
                    ident_type: None,
                },
                data_type: Float32,
                expr: Some(
                    Default(
                        Literal {
                            span: Some(
                                41..44,
                            ),
                            value: Decimal256 {
                                value: 11,
                                precision: 76,
                                scale: 1,
                            },
                        },
                    ),
                ),
                check: None,
                comment: Some(
                    "hello",
                ),
            },
            option: First,
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD COLUMN b string default 'b' AFTER a;
---------- Output ---------
ALTER TABLE t ADD COLUMN b STRING DEFAULT 'b' AFTER a
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddColumn {
            column: ColumnDefinition {
                name: Identifier {
                    span: Some(
                        25..26,
                    ),
                    name: "b",
                    quote: None,
                    ident_type: None,
                },
                data_type: String,
                expr: Some(
                    Default(
                        Literal {
                            span: Some(
                                42..45,
                            ),
                            value: String(
                                "b",
                            ),
                        },
                    ),
                ),
                check: None,
                comment: None,
            },
            option: After(
                Identifier {
                    span: Some(
                        52..53,
                    ),
                    name: "a",
                    quote: None,
                    ident_type: None,
                },
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t RENAME COLUMN a TO b;
---------- Output ---------
ALTER TABLE t RENAME COLUMN a TO b
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: RenameColumn {
            old_column: Identifier {
                span: Some(
                    28..29,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
            new_column: Identifier {
                span: Some(
                    33..34,
                ),
                name: "b",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t DROP COLUMN b;
---------- Output ---------
ALTER TABLE t DROP COLUMN b
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: DropColumn {
            column: Identifier {
                span: Some(
                    26..27,
                ),
                name: "b",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t DROP b;
---------- Output ---------
ALTER TABLE t DROP COLUMN b
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: DropColumn {
            column: Identifier {
                span: Some(
                    19..20,
                ),
                name: "b",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN b SET MASKING POLICY mask;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN b SET MASKING POLICY mask
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetMaskingPolicy(
                Identifier {
                    span: Some(
                        28..29,
                    ),
                    name: "b",
                    quote: None,
                    ident_type: None,
                },
                "mask",
                None,
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN b SET MASKING POLICY mask USING (b, c1);
---------- Output ---------
ALTER TABLE t MODIFY COLUMN b SET MASKING POLICY mask USING (b, c1)
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetMaskingPolicy(
                Identifier {
                    span: Some(
                        28..29,
                    ),
                    name: "b",
                    quote: None,
                    ident_type: None,
                },
                "mask",
                Some(
                    [
                        Identifier {
                            span: Some(
                                61..62,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        Identifier {
                            span: Some(
                                64..66,
                            ),
                            name: "c1",
                            quote: None,
                            ident_type: None,
                        },
                    ],
                ),
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN b UNSET MASKING POLICY;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN b UNSET MASKING POLICY
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: UnsetMaskingPolicy(
                Identifier {
                    span: Some(
                        28..29,
                    ),
                    name: "b",
                    quote: None,
                    ident_type: None,
                },
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD ROW ACCESS POLICY p1 ON (col1);
---------- Output ---------
ALTER TABLE t ADD ROW ACCESS POLICY p1 ON (col1)
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddRowAccessPolicy {
            columns: [
                Identifier {
                    span: Some(
                        43..47,
                    ),
                    name: "col1",
                    quote: None,
                    ident_type: None,
                },
            ],
            policy: Identifier {
                span: Some(
                    36..38,
                ),
                name: "p1",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD ROW ACCESS POLICY p1 ON (col1, col2, col3);
---------- Output ---------
ALTER TABLE t ADD ROW ACCESS POLICY p1 ON (col1, col2, col3)
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddRowAccessPolicy {
            columns: [
                Identifier {
                    span: Some(
                        43..47,
                    ),
                    name: "col1",
                    quote: None,
                    ident_type: None,
                },
                Identifier {
                    span: Some(
                        49..53,
                    ),
                    name: "col2",
                    quote: None,
                    ident_type: None,
                },
                Identifier {
                    span: Some(
                        55..59,
                    ),
                    name: "col3",
                    quote: None,
                    ident_type: None,
                },
            ],
            policy: Identifier {
                span: Some(
                    36..38,
                ),
                name: "p1",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t drop row access policy p1;
---------- Output ---------
ALTER TABLE t DROP ROW ACCESS POLICY p1
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: DropRowAccessPolicy {
            policy: Identifier {
                span: Some(
                    37..39,
                ),
                name: "p1",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t drop all row access policies;
---------- Output ---------
ALTER TABLE t DROP ALL ROW ACCESS POLICIES
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: DropAllRowAccessPolicies,
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a int DEFAULT 1, COLUMN b float;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a Int32 DEFAULT 1, b Float32
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetDataType(
                [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        42..43,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                52..53,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Float32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a int NULL DEFAULT 1, b float NOT NULL;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a Int32 NULL DEFAULT 1, b Float32 NOT NULL
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetDataType(
                [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            Int32,
                        ),
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        47..48,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                50..51,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Float32,
                        ),
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a int NULL DEFAULT 1, COLUMN b float NOT NULL COMMENT 'column b';
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a Int32 NULL DEFAULT 1, b Float32 NOT NULL COMMENT 'column b'
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetDataType(
                [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            Int32,
                        ),
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        47..48,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                57..58,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Float32,
                        ),
                        expr: None,
                        check: None,
                        comment: Some(
                            "column b",
                        ),
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a int NULL DEFAULT 1 comment 'column a', COLUMN b float NOT NULL COMMENT 'column b';
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a Int32 NULL DEFAULT 1 COMMENT 'column a', b Float32 NOT NULL COMMENT 'column b'
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetDataType(
                [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Nullable(
                            Int32,
                        ),
                        expr: Some(
                            Default(
                                Literal {
                                    span: Some(
                                        47..48,
                                    ),
                                    value: UInt64(
                                        1,
                                    ),
                                },
                            ),
                        ),
                        check: None,
                        comment: Some(
                            "column a",
                        ),
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                76..77,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: NotNull(
                            Float32,
                        ),
                        expr: None,
                        check: None,
                        comment: Some(
                            "column b",
                        ),
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a comment 'column a', COLUMN b COMMENT 'column b';
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a COMMENT 'column a', b COMMENT 'column b'
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: Comment(
                [
                    ColumnComment {
                        name: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        comment: "column a",
                    },
                    ColumnComment {
                        name: Identifier {
                            span: Some(
                                57..58,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        comment: "column b",
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a int;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a Int32
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetDataType(
                [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY a int;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a Int32
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: SetDataType(
                [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                21..22,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t MODIFY COLUMN a DROP STORED;
---------- Output ---------
ALTER TABLE t MODIFY COLUMN a DROP STORED
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: ConvertStoredComputedColumn(
                Identifier {
                    span: Some(
                        28..29,
                    ),
                    name: "a",
                    quote: None,
                    ident_type: None,
                },
            ),
        },
    },
)


---------- Input ----------
ALTER TABLE t SET OPTIONS(SNAPSHOT_LOCATION='1/7/_ss/101fd790dbbe4238a31a8f2e2f856179_v4.mpk',block_per_segment = 500);
---------- Output ---------
ALTER TABLE t SET OPTIONS (block_per_segment = '500', snapshot_location = '1/7/_ss/101fd790dbbe4238a31a8f2e2f856179_v4.mpk')
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: SetOptions {
            set_options: {
                "block_per_segment": "500",
                "snapshot_location": "1/7/_ss/101fd790dbbe4238a31a8f2e2f856179_v4.mpk",
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD CONSTRAINT a_not_1 CHECK (a != 1);
---------- Output ---------
ALTER TABLE t ADD CONSTRAINT a_not_1 CHECK (a <> 1)
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddConstraint {
            constraint: ConstraintDefinition {
                name: Some(
                    Identifier {
                        span: Some(
                            29..36,
                        ),
                        name: "a_not_1",
                        quote: None,
                        ident_type: None,
                    },
                ),
                constraint_type: Check(
                    BinaryOp {
                        span: Some(
                            46..48,
                        ),
                        op: NotEq,
                        left: ColumnRef {
                            span: Some(
                                44..45,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            44..45,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                49..50,
                            ),
                            value: UInt64(
                                1,
                            ),
                        },
                    },
                ),
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t ADD CHECK (a != 1);
---------- Output ---------
ALTER TABLE t ADD CHECK (a <> 1)
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: AddConstraint {
            constraint: ConstraintDefinition {
                name: None,
                constraint_type: Check(
                    BinaryOp {
                        span: Some(
                            27..29,
                        ),
                        op: NotEq,
                        left: ColumnRef {
                            span: Some(
                                25..26,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            25..26,
                                        ),
                                        name: "a",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                30..31,
                            ),
                            value: UInt64(
                                1,
                            ),
                        },
                    },
                ),
            },
        },
    },
)


---------- Input ----------
ALTER TABLE t DROP CONSTRAINT a_not_1;
---------- Output ---------
ALTER TABLE t DROP CONSTRAINT a_not_1
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: DropConstraint {
            constraint_name: Identifier {
                span: Some(
                    30..37,
                ),
                name: "a_not_1",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER DATABASE IF EXISTS ctl.c RENAME TO a;
---------- Output ---------
ALTER DATABASE IF EXISTS ctl.c RENAME TO a
---------- AST ------------
AlterDatabase(
    AlterDatabaseStmt {
        if_exists: true,
        catalog: Some(
            Identifier {
                span: Some(
                    25..28,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Identifier {
            span: Some(
                29..30,
            ),
            name: "c",
            quote: None,
            ident_type: None,
        },
        action: RenameDatabase {
            new_db: Identifier {
                span: Some(
                    41..42,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER DATABASE c RENAME TO a;
---------- Output ---------
ALTER DATABASE c RENAME TO a
---------- AST ------------
AlterDatabase(
    AlterDatabaseStmt {
        if_exists: false,
        catalog: None,
        database: Identifier {
            span: Some(
                15..16,
            ),
            name: "c",
            quote: None,
            ident_type: None,
        },
        action: RenameDatabase {
            new_db: Identifier {
                span: Some(
                    27..28,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER DATABASE ctl.c RENAME TO a;
---------- Output ---------
ALTER DATABASE ctl.c RENAME TO a
---------- AST ------------
AlterDatabase(
    AlterDatabaseStmt {
        if_exists: false,
        catalog: Some(
            Identifier {
                span: Some(
                    15..18,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Identifier {
            span: Some(
                19..20,
            ),
            name: "c",
            quote: None,
            ident_type: None,
        },
        action: RenameDatabase {
            new_db: Identifier {
                span: Some(
                    31..32,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        },
    },
)


---------- Input ----------
ALTER DATABASE ctl.c refresh cache;
---------- Output ---------
ALTER DATABASE ctl.c REFRESH CACHE
---------- AST ------------
AlterDatabase(
    AlterDatabaseStmt {
        if_exists: false,
        catalog: Some(
            Identifier {
                span: Some(
                    15..18,
                ),
                name: "ctl",
                quote: None,
                ident_type: None,
            },
        ),
        database: Identifier {
            span: Some(
                19..20,
            ),
            name: "c",
            quote: None,
            ident_type: None,
        },
        action: RefreshDatabaseCache,
    },
)


---------- Input ----------
VACUUM TABLE t;
---------- Output ---------
VACUUM TABLE t 
---------- AST ------------
VacuumTable(
    VacuumTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        option: VacuumTableOption {
            dry_run: None,
        },
    },
)


---------- Input ----------
VACUUM TABLE t DRY RUN;
---------- Output ---------
VACUUM TABLE t DRY RUN
---------- AST ------------
VacuumTable(
    VacuumTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        option: VacuumTableOption {
            dry_run: Some(
                false,
            ),
        },
    },
)


---------- Input ----------
VACUUM TABLE t DRY RUN SUMMARY;
---------- Output ---------
VACUUM TABLE t DRY RUN SUMMARY
---------- AST ------------
VacuumTable(
    VacuumTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        option: VacuumTableOption {
            dry_run: Some(
                true,
            ),
        },
    },
)


---------- Input ----------
VACUUM DROP TABLE;
---------- Output ---------
VACUUM DROP TABLE 
---------- AST ------------
VacuumDropTable(
    VacuumDropTableStmt {
        catalog: None,
        database: None,
        option: VacuumDropTableOption {
            dry_run: None,
            limit: None,
        },
    },
)


---------- Input ----------
VACUUM DROP TABLE DRY RUN;
---------- Output ---------
VACUUM DROP TABLE DRY RUN
---------- AST ------------
VacuumDropTable(
    VacuumDropTableStmt {
        catalog: None,
        database: None,
        option: VacuumDropTableOption {
            dry_run: Some(
                false,
            ),
            limit: None,
        },
    },
)


---------- Input ----------
VACUUM DROP TABLE DRY RUN SUMMARY;
---------- Output ---------
VACUUM DROP TABLE DRY RUN SUMMARY
---------- AST ------------
VacuumDropTable(
    VacuumDropTableStmt {
        catalog: None,
        database: None,
        option: VacuumDropTableOption {
            dry_run: Some(
                true,
            ),
            limit: None,
        },
    },
)


---------- Input ----------
VACUUM DROP TABLE FROM db;
---------- Output ---------
VACUUM DROP TABLE FROM db 
---------- AST ------------
VacuumDropTable(
    VacuumDropTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    23..25,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        option: VacuumDropTableOption {
            dry_run: None,
            limit: None,
        },
    },
)


---------- Input ----------
VACUUM DROP TABLE FROM db LIMIT 10;
---------- Output ---------
VACUUM DROP TABLE FROM db  LIMIT 10
---------- AST ------------
VacuumDropTable(
    VacuumDropTableStmt {
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    23..25,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        option: VacuumDropTableOption {
            dry_run: None,
            limit: Some(
                10,
            ),
        },
    },
)


---------- Input ----------
CREATE TABLE t (a INT COMMENT 'col comment') COMMENT='Comment types type speedily \' \\\\ \'\' Fun!';
---------- Output ---------
CREATE TABLE t (a Int32 COMMENT 'col comment') comment = 'Comment types type speedily \' \\\\ \'\' Fun!'
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                16..17,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: Some(
                            "col comment",
                        ),
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {
            "comment": "Comment types type speedily ' \\\\ '' Fun!",
        },
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Normal,
    },
)


---------- Input ----------
COMMENT IF EXISTS ON TABLE t IS 'test'
---------- Output ---------
ALTER TABLE IF EXISTS t COMMENT='test'
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: true,
        table_reference: Table {
            span: Some(
                27..28,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    27..28,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyTableComment {
            new_comment: "test",
        },
    },
)


---------- Input ----------
COMMENT ON COLUMN t.C1 IS 'test'
---------- Output ---------
ALTER TABLE t MODIFY COLUMN C1 COMMENT 'test'
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                18..22,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    18..19,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyColumn {
            action: Comment(
                [
                    ColumnComment {
                        name: Identifier {
                            span: Some(
                                20..22,
                            ),
                            name: "C1",
                            quote: None,
                            ident_type: None,
                        },
                        comment: "test",
                    },
                ],
            ),
        },
    },
)


---------- Input ----------
COMMENT ON network policy n1 IS 'test'
---------- Output ---------
ALTER NETWORK POLICY n1 SET  COMMENT = 'test'
---------- AST ------------
AlterNetworkPolicy(
    AlterNetworkPolicyStmt {
        if_exists: false,
        name: "n1",
        allowed_ip_list: None,
        blocked_ip_list: None,
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
COMMENT ON password policy p1 IS 'test'
---------- Output ---------
ALTER PASSWORD POLICY p1 SET  COMMENT = 'test'
---------- AST ------------
AlterPasswordPolicy(
    AlterPasswordPolicyStmt {
        if_exists: false,
        name: "p1",
        action: SetOptions(
            PasswordSetOptions {
                min_length: None,
                max_length: None,
                min_upper_case_chars: None,
                min_lower_case_chars: None,
                min_numeric_chars: None,
                min_special_chars: None,
                min_age_days: None,
                max_age_days: None,
                max_retries: None,
                lockout_time_mins: None,
                history: None,
                comment: Some(
                    "test",
                ),
            },
        ),
    },
)


---------- Input ----------
CREATE TEMPORARY TABLE t (a INT COMMENT 'col comment')
---------- Output ---------
CREATE TEMPORARY TABLE t (a Int32 COMMENT 'col comment')
---------- AST ------------
CreateTable(
    CreateTableStmt {
        create_option: Create,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                23..24,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                26..27,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: Some(
                            "col comment",
                        ),
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        engine: None,
        uri_location: None,
        cluster_by: None,
        table_options: {},
        iceberg_table_partition: None,
        table_properties: None,
        as_query: None,
        table_type: Temporary,
    },
)


---------- Input ----------
GRANT CREATE, CREATE USER ON * TO 'test-grant';
---------- Output ---------
GRANT CREATE, CREATE USER ON  * TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Create,
                CreateUser,
            ],
            level: Database(
                None,
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT access connection, create connection ON *.*  TO 'test-grant';
---------- Output ---------
GRANT ACCESS CONNECTION, CREATE CONNECTION ON  *.* TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                AccessConnection,
                CreateConnection,
            ],
            level: Global,
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT access connection on connection c1  TO 'test-grant';
---------- Output ---------
GRANT ACCESS CONNECTION ON  CONNECTION c1 TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                AccessConnection,
            ],
            level: Connection(
                "c1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT all on connection c1  TO 'test-grant';
---------- Output ---------
GRANT ACCESS CONNECTION ON  CONNECTION c1 TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                AccessConnection,
            ],
            level: Connection(
                "c1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT OWNERSHIP on connection c1  TO role r1;
---------- Output ---------
GRANT OWNERSHIP ON  CONNECTION c1 TO ROLE 'r1'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: Connection(
                "c1",
            ),
        },
        principal: Role(
            "r1",
        ),
    },
)


---------- Input ----------
GRANT access sequence, create sequence ON *.*  TO 'test-grant';
---------- Output ---------
GRANT ACCESS SEQUENCE, CREATE SEQUENCE ON  *.* TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                AccessSequence,
                CreateSequence,
            ],
            level: Global,
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT access sequence on sequence s1  TO 'test-grant';
---------- Output ---------
GRANT ACCESS SEQUENCE ON  SEQUENCE s1 TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                AccessSequence,
            ],
            level: Sequence(
                "s1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT all on sequence s1  TO 'test-grant';
---------- Output ---------
GRANT ACCESS SEQUENCE ON  SEQUENCE s1 TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                AccessSequence,
            ],
            level: Sequence(
                "s1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT OWNERSHIP on sequence s1  TO role r1;
---------- Output ---------
GRANT OWNERSHIP ON  SEQUENCE s1 TO ROLE 'r1'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: Sequence(
                "s1",
            ),
        },
        principal: Role(
            "r1",
        ),
    },
)


---------- Input ----------
GRANT SELECT, CREATE ON * TO 'test-grant';
---------- Output ---------
GRANT SELECT, CREATE ON  * TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
                Create,
            ],
            level: Database(
                None,
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT, CREATE ON *.* TO 'test-grant';
---------- Output ---------
GRANT SELECT, CREATE ON  *.* TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
                Create,
            ],
            level: Global,
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT, CREATE ON * TO USER 'test-grant';
---------- Output ---------
GRANT SELECT, CREATE ON  * TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
                Create,
            ],
            level: Database(
                None,
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT, CREATE ON * TO ROLE role1;
---------- Output ---------
GRANT SELECT, CREATE ON  * TO ROLE 'role1'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
                Create,
            ],
            level: Database(
                None,
            ),
        },
        principal: Role(
            "role1",
        ),
    },
)


---------- Input ----------
GRANT ALL ON *.* TO 'test-grant';
---------- Output ---------
GRANT ALL PRIVILEGES ON  *.* TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: ALL {
            level: Global,
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT ALL ON *.* TO ROLE role2;
---------- Output ---------
GRANT ALL PRIVILEGES ON  *.* TO ROLE 'role2'
---------- AST ------------
Grant(
    GrantStmt {
        source: ALL {
            level: Global,
        },
        principal: Role(
            "role2",
        ),
    },
)


---------- Input ----------
GRANT ALL PRIVILEGES ON * TO 'test-grant';
---------- Output ---------
GRANT ALL PRIVILEGES ON  * TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: ALL {
            level: Database(
                None,
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT ALL PRIVILEGES ON * TO ROLE role3;
---------- Output ---------
GRANT ALL PRIVILEGES ON  * TO ROLE 'role3'
---------- AST ------------
Grant(
    GrantStmt {
        source: ALL {
            level: Database(
                None,
            ),
        },
        principal: Role(
            "role3",
        ),
    },
)


---------- Input ----------
GRANT ROLE test TO 'test-user';
---------- Output ---------
GRANT ROLE 'test' TO USER 'test-user'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Role {
            role: "test",
        },
        principal: User(
            UserIdentity {
                username: "test-user",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT ROLE test TO USER 'test-user';
---------- Output ---------
GRANT ROLE 'test' TO USER 'test-user'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Role {
            role: "test",
        },
        principal: User(
            UserIdentity {
                username: "test-user",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT ROLE test TO ROLE `test-user`;
---------- Output ---------
GRANT ROLE 'test' TO ROLE 'test-user'
---------- AST ------------
Grant(
    GrantStmt {
        source: Role {
            role: "test",
        },
        principal: Role(
            "test-user",
        ),
    },
)


---------- Input ----------
GRANT SELECT ON db01.* TO 'test-grant';
---------- Output ---------
GRANT SELECT ON  db01.* TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Database(
                Some(
                    "db01",
                ),
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT ON db01.* TO USER 'test-grant';
---------- Output ---------
GRANT SELECT ON  db01.* TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Database(
                Some(
                    "db01",
                ),
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT ON db01.* TO ROLE role1
---------- Output ---------
GRANT SELECT ON  db01.* TO ROLE 'role1'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Database(
                Some(
                    "db01",
                ),
            ),
        },
        principal: Role(
            "role1",
        ),
    },
)


---------- Input ----------
GRANT SELECT ON db01.tb1 TO 'test-grant';
---------- Output ---------
GRANT SELECT ON  db01.tb1 TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Table(
                Some(
                    "db01",
                ),
                "tb1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT ON db01.tb1 TO USER 'test-grant';
---------- Output ---------
GRANT SELECT ON  db01.tb1 TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Table(
                Some(
                    "db01",
                ),
                "tb1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT SELECT ON db01.tb1 TO ROLE role1;
---------- Output ---------
GRANT SELECT ON  db01.tb1 TO ROLE 'role1'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Table(
                Some(
                    "db01",
                ),
                "tb1",
            ),
        },
        principal: Role(
            "role1",
        ),
    },
)


---------- Input ----------
GRANT SELECT ON tb1 TO ROLE role1;
---------- Output ---------
GRANT SELECT ON  tb1 TO ROLE 'role1'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Table(
                None,
                "tb1",
            ),
        },
        principal: Role(
            "role1",
        ),
    },
)


---------- Input ----------
GRANT ALL ON tb1 TO 'u1';
---------- Output ---------
GRANT ALL PRIVILEGES ON  tb1 TO USER 'u1'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: ALL {
            level: Table(
                None,
                "tb1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
SHOW GRANTS;
---------- Output ---------
SHOW GRANTS 
---------- AST ------------
ShowGrants {
    principal: None,
    show_options: Some(
        ShowOptions {
            show_limit: None,
            limit: None,
        },
    ),
}


---------- Input ----------
SHOW GRANTS FOR 'test-grant';
---------- Output ---------
SHOW GRANTS FOR USER 'test-grant'@'%' 
---------- AST ------------
ShowGrants {
    principal: Some(
        User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    ),
    show_options: Some(
        ShowOptions {
            show_limit: None,
            limit: None,
        },
    ),
}


---------- Input ----------
SHOW GRANTS FOR USER 'test-grant';
---------- Output ---------
SHOW GRANTS FOR USER 'test-grant'@'%' 
---------- AST ------------
ShowGrants {
    principal: Some(
        User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    ),
    show_options: Some(
        ShowOptions {
            show_limit: None,
            limit: None,
        },
    ),
}


---------- Input ----------
SHOW GRANTS FOR ROLE role1;
---------- Output ---------
SHOW GRANTS FOR ROLE 'role1' 
---------- AST ------------
ShowGrants {
    principal: Some(
        Role(
            "role1",
        ),
    ),
    show_options: Some(
        ShowOptions {
            show_limit: None,
            limit: None,
        },
    ),
}


---------- Input ----------
SHOW GRANTS FOR ROLE 'role1';
---------- Output ---------
SHOW GRANTS FOR ROLE 'role1' 
---------- AST ------------
ShowGrants {
    principal: Some(
        Role(
            "role1",
        ),
    ),
    show_options: Some(
        ShowOptions {
            show_limit: None,
            limit: None,
        },
    ),
}


---------- Input ----------
SHOW GRANTS OF ROLE 'role1' like 'r';
---------- Output ---------
SHOW GRANTS OF ROLE role1 LIKE 'r'
---------- AST ------------
ShowGrantsOfRole(
    ShowGranteesOfRoleStmt {
        name: "role1",
        show_option: Some(
            ShowOptions {
                show_limit: Some(
                    Like {
                        pattern: "r",
                    },
                ),
                limit: None,
            },
        ),
    },
)


---------- Input ----------
SHOW GRANTS ON TABLE t;
---------- Output ---------
SHOW GRANTS ON TABLE t 
---------- AST ------------
ShowObjectPrivileges(
    ShowObjectPrivilegesStmt {
        object: Table(
            None,
            "t",
        ),
        show_option: Some(
            ShowOptions {
                show_limit: None,
                limit: None,
            },
        ),
    },
)


---------- Input ----------
REVOKE SELECT, CREATE ON * FROM 'test-grant';
---------- Output ---------
REVOKE SELECT, CREATE ON  * FROM USER 'test-grant'@'%'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Select,
                Create,
            ],
            level: Database(
                None,
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
REVOKE SELECT ON tb1 FROM ROLE role1;
---------- Output ---------
REVOKE SELECT ON  tb1 FROM ROLE 'role1'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Table(
                None,
                "tb1",
            ),
        },
        principal: Role(
            "role1",
        ),
    },
)


---------- Input ----------
REVOKE SELECT ON tb1 FROM ROLE 'role1';
---------- Output ---------
REVOKE SELECT ON  tb1 FROM ROLE 'role1'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Select,
            ],
            level: Table(
                None,
                "tb1",
            ),
        },
        principal: Role(
            "role1",
        ),
    },
)


---------- Input ----------
drop role 'role1';
---------- Output ---------
DROP ROLE 'role1'
---------- AST ------------
DropRole {
    if_exists: false,
    role_name: "role1",
}


---------- Input ----------
GRANT ROLE test TO ROLE 'test-user';
---------- Output ---------
GRANT ROLE 'test' TO ROLE 'test-user'
---------- AST ------------
Grant(
    GrantStmt {
        source: Role {
            role: "test",
        },
        principal: Role(
            "test-user",
        ),
    },
)


---------- Input ----------
GRANT ROLE test TO ROLE `test-user`;
---------- Output ---------
GRANT ROLE 'test' TO ROLE 'test-user'
---------- AST ------------
Grant(
    GrantStmt {
        source: Role {
            role: "test",
        },
        principal: Role(
            "test-user",
        ),
    },
)


---------- Input ----------
SET ROLE `test-user`;
---------- Output ---------
SET ROLE 'test-user'
---------- AST ------------
SetRole {
    is_default: false,
    role_name: "test-user",
}


---------- Input ----------
SET ROLE 'test-user';
---------- Output ---------
SET ROLE 'test-user'
---------- AST ------------
SetRole {
    is_default: false,
    role_name: "test-user",
}


---------- Input ----------
SET ROLE ROLE1;
---------- Output ---------
SET ROLE 'ROLE1'
---------- AST ------------
SetRole {
    is_default: false,
    role_name: "ROLE1",
}


---------- Input ----------
REVOKE ALL ON tb1 FROM 'u1';
---------- Output ---------
REVOKE ALL PRIVILEGES ON  tb1 FROM USER 'u1'@'%'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: ALL {
            level: Table(
                None,
                "tb1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "u1",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
COPY INTO mytable
    FROM '@~/mybucket/my data.csv'
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM '@~/mybucket/my data.csv'  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Stage(
                "~/mybucket/my data.csv",
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {},
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM @~/mybucket/data.csv
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM '@~/mybucket/data.csv' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Stage(
                "~/mybucket/data.csv",
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 's3://mybucket/data.csv'
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10
    max_files=10;
---------- Output ---------
COPY INTO mytable FROM 's3://mybucket/data.csv' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 MAX_FILES = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "s3",
                    name: "mybucket",
                    path: "/data.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {},
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 10,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 's3://mybucket/data.csv'
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10
    max_files=3000;
---------- Output ---------
COPY INTO mytable FROM 's3://mybucket/data.csv' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 MAX_FILES = 3000 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "s3",
                    name: "mybucket",
                    path: "/data.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {},
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 3000,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 's3://mybucket/data.csv'
    CONNECTION = (
        ENDPOINT_URL = 'http://127.0.0.1:9900'
    )
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM 's3://mybucket/data.csv' CONNECTION = ( endpoint_url = 'http://127.0.0.1:9900' ) FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "s3",
                    name: "mybucket",
                    path: "/data.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {
                            "endpoint_url": "http://127.0.0.1:9900",
                        },
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 's3://mybucket/data.csv'
    CONNECTION = (
        ENDPOINT_URL = 'http://127.0.0.1:9900'
    )
    size_limit=10
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    );
---------- Output ---------
COPY INTO mytable FROM 's3://mybucket/data.csv' CONNECTION = ( endpoint_url = 'http://127.0.0.1:9900' ) FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "s3",
                    name: "mybucket",
                    path: "/data.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {
                            "endpoint_url": "http://127.0.0.1:9900",
                        },
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 'https://127.0.0.1:9900';
---------- Output ---------
COPY INTO mytable FROM 'https://127.0.0.1:9900/'  PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "https",
                    name: "127.0.0.1:9900",
                    path: "/",
                    connection: Connection {
                        visited_keys: {},
                        conns: {},
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {},
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 0,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 'https://127.0.0.1:';
---------- Output ---------
COPY INTO mytable FROM 'https://127.0.0.1/'  PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "https",
                    name: "127.0.0.1",
                    path: "/",
                    connection: Connection {
                        visited_keys: {},
                        conns: {},
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {},
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 0,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM @my_stage
    FILE_FORMAT = (
        type = CSV,
        field_delimiter = ',',
        record_delimiter = '\n',
        skip_header = 1,
        error_on_column_count_mismatch = FALSE
    )
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM '@my_stage' FILE_FORMAT = (error_on_column_count_mismatch = false, field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Stage(
                "my_stage",
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "error_on_column_count_mismatch": Bool(
                    false,
                ),
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO 's3://mybucket/data.csv'
    FROM mytable
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
---------- Output ---------
COPY INTO 's3://mybucket/data.csv' FROM mytable FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV) SINGLE = false MAX_FILE_SIZE = 0 DETAILED_OUTPUT = false INCLUDE_QUERY_ID = true USE_RAW_PATH = false OVERWRITE = false
---------- AST ------------
CopyIntoLocation(
    CopyIntoLocationStmt {
        with: None,
        hints: None,
        src: Table(
            TableRef {
                catalog: None,
                database: None,
                table: Identifier {
                    span: Some(
                        44..51,
                    ),
                    name: "mytable",
                    quote: None,
                    ident_type: None,
                },
                with_options: None,
            },
        ),
        dst: Uri(
            UriLocation {
                protocol: "s3",
                name: "mybucket",
                path: "/data.csv",
                connection: Connection {
                    visited_keys: {},
                    conns: {},
                },
            },
        ),
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        options: CopyIntoLocationOptions {
            single: false,
            max_file_size: 0,
            detailed_output: false,
            use_raw_path: false,
            include_query_id: true,
            overwrite: false,
        },
    },
)


---------- Input ----------
COPY INTO '@my_stage/my data'
    FROM mytable;
---------- Output ---------
COPY INTO '@my_stage/my data' FROM mytable SINGLE = false MAX_FILE_SIZE = 0 DETAILED_OUTPUT = false INCLUDE_QUERY_ID = true USE_RAW_PATH = false OVERWRITE = false
---------- AST ------------
CopyIntoLocation(
    CopyIntoLocationStmt {
        with: None,
        hints: None,
        src: Table(
            TableRef {
                catalog: None,
                database: None,
                table: Identifier {
                    span: Some(
                        39..46,
                    ),
                    name: "mytable",
                    quote: None,
                    ident_type: None,
                },
                with_options: None,
            },
        ),
        dst: Stage(
            "my_stage/my data",
        ),
        file_format: FileFormatOptions {
            options: {},
        },
        options: CopyIntoLocationOptions {
            single: false,
            max_file_size: 0,
            detailed_output: false,
            use_raw_path: false,
            include_query_id: true,
            overwrite: false,
        },
    },
)


---------- Input ----------
COPY INTO @my_stage
    FROM mytable
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    );
---------- Output ---------
COPY INTO '@my_stage' FROM mytable FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV) SINGLE = false MAX_FILE_SIZE = 0 DETAILED_OUTPUT = false INCLUDE_QUERY_ID = true USE_RAW_PATH = false OVERWRITE = false
---------- AST ------------
CopyIntoLocation(
    CopyIntoLocationStmt {
        with: None,
        hints: None,
        src: Table(
            TableRef {
                catalog: None,
                database: None,
                table: Identifier {
                    span: Some(
                        29..36,
                    ),
                    name: "mytable",
                    quote: None,
                    ident_type: None,
                },
                with_options: None,
            },
        ),
        dst: Stage(
            "my_stage",
        ),
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        options: CopyIntoLocationOptions {
            single: false,
            max_file_size: 0,
            detailed_output: false,
            use_raw_path: false,
            include_query_id: true,
            overwrite: false,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 's3://mybucket/data.csv'
    CONNECTION = (
        AWS_KEY_ID = 'access_key'
        AWS_SECRET_KEY = 'secret_key'
    )
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM 's3://mybucket/data.csv' CONNECTION = ( aws_key_id = 'access_key', aws_secret_key = 'secret_key' ) FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "s3",
                    name: "mybucket",
                    path: "/data.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {
                            "aws_key_id": "access_key",
                            "aws_secret_key": "secret_key",
                        },
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM @external_stage/path/to/file.csv
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM '@external_stage/path/to/file.csv' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Stage(
                "external_stage/path/to/file.csv",
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM @external_stage/path/to/dir/
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10;
---------- Output ---------
COPY INTO mytable FROM '@external_stage/path/to/dir/' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Stage(
                "external_stage/path/to/dir/",
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM @external_stage/path/to/file.csv
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    force=true;
---------- Output ---------
COPY INTO mytable FROM '@external_stage/path/to/file.csv' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  PURGE = false FORCE = true DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Stage(
                "external_stage/path/to/file.csv",
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 0,
            max_files: 0,
            split_size: 0,
            force: true,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO mytable
    FROM 'fs:///path/to/data.csv'
    FILE_FORMAT = (
        type = CSV
        field_delimiter = ','
        record_delimiter = '\n'
        skip_header = 1
    )
    size_limit=10
    disable_variant_check=true;
---------- Output ---------
COPY INTO mytable FROM 'fs:///path/to/data.csv' FILE_FORMAT = (field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV)  SIZE_LIMIT = 10 PURGE = false FORCE = false DISABLE_VARIANT_CHECK = true ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "fs",
                    name: "",
                    path: "/path/to/data.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {},
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..17,
                ),
                name: "mytable",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "field_delimiter": String(
                    ",",
                ),
                "record_delimiter": String(
                    "\n",
                ),
                "skip_header": U64(
                    1,
                ),
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 10,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: true,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
COPY INTO books FROM 's3://databend/books.csv'
    CONNECTION = (
        ENDPOINT_URL = 'http://localhost:9000/',
        ACCESS_KEY_ID = 'ROOTUSER',
        SECRET_ACCESS_KEY = 'CHANGEME123',
        region = 'us-west-2'
    )
    FILE_FORMAT = (type = CSV);
---------- Output ---------
COPY INTO books FROM 's3://databend/books.csv' CONNECTION = ( access_key_id = 'ROOTUSER', endpoint_url = 'http://localhost:9000/', region = 'us-west-2', secret_access_key = 'CHANGEME123' ) FILE_FORMAT = (type = CSV)  PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CopyIntoTable(
    CopyIntoTableStmt {
        with: None,
        src: Location(
            Uri(
                UriLocation {
                    protocol: "s3",
                    name: "databend",
                    path: "/books.csv",
                    connection: Connection {
                        visited_keys: {},
                        conns: {
                            "access_key_id": "ROOTUSER",
                            "endpoint_url": "http://localhost:9000/",
                            "region": "us-west-2",
                            "secret_access_key": "CHANGEME123",
                        },
                    },
                },
            ),
        ),
        dst: TableRef {
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    10..15,
                ),
                name: "books",
                quote: None,
                ident_type: None,
            },
            with_options: None,
        },
        dst_columns: None,
        hints: None,
        file_format: FileFormatOptions {
            options: {
                "type": Keyword(
                    "CSV",
                ),
            },
        },
        files: None,
        pattern: None,
        options: CopyIntoTableOptions {
            on_error: AbortNum(
                1,
            ),
            size_limit: 0,
            max_files: 0,
            split_size: 0,
            force: false,
            purge: false,
            disable_variant_check: false,
            return_failed_only: false,
            validation_mode: "",
            column_match_mode: None,
        },
    },
)


---------- Input ----------
CALL system$test(a)
---------- Output ---------
CALL system$test('a')
---------- AST ------------
Call(
    CallStmt {
        name: Identifier {
            span: Some(
                5..16,
            ),
            name: "system$test",
            quote: None,
            ident_type: None,
        },
        args: [
            "a",
        ],
    },
)


---------- Input ----------
CALL system$test('a')
---------- Output ---------
CALL system$test('a')
---------- AST ------------
Call(
    CallStmt {
        name: Identifier {
            span: Some(
                5..16,
            ),
            name: "system$test",
            quote: None,
            ident_type: None,
        },
        args: [
            "a",
        ],
    },
)


---------- Input ----------
show settings like 'enable%' limit 1
---------- Output ---------
SHOW SETTINGS LIKE 'enable%' LIMIT 1
---------- AST ------------
ShowSettings {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "enable%",
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show settings where name='max_memory_usage' limit 1
---------- Output ---------
SHOW SETTINGS WHERE name = 'max_memory_usage' LIMIT 1
---------- AST ------------
ShowSettings {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            24..25,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                20..24,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            20..24,
                                        ),
                                        name: "name",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                25..43,
                            ),
                            value: String(
                                "max_memory_usage",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show functions like 'today%' limit 1
---------- Output ---------
SHOW FUNCTIONS LIKE 'today%' LIMIT 1
---------- AST ------------
ShowFunctions {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "today%",
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show functions where name='to_day_of_year' limit 1
---------- Output ---------
SHOW FUNCTIONS WHERE name = 'to_day_of_year' LIMIT 1
---------- AST ------------
ShowFunctions {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            25..26,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                21..25,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            21..25,
                                        ),
                                        name: "name",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                26..42,
                            ),
                            value: String(
                                "to_day_of_year",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show engines like 'FU%' limit 1
---------- Output ---------
SHOW ENGINES LIKE 'FU%' LIMIT 1
---------- AST ------------
ShowEngines {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "FU%",
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show engines where engine='MEMORY' limit 1
---------- Output ---------
SHOW ENGINES WHERE engine = 'MEMORY' LIMIT 1
---------- AST ------------
ShowEngines {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            25..26,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                19..25,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            19..25,
                                        ),
                                        name: "engine",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                26..34,
                            ),
                            value: String(
                                "MEMORY",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show metrics like '%parse%' limit 1
---------- Output ---------
SHOW METRICS LIKE '%parse%' LIMIT 1
---------- AST ------------
ShowMetrics {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "%parse%",
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show metrics where metric='session_connect_numbers' limit 1
---------- Output ---------
SHOW METRICS WHERE metric = 'session_connect_numbers' LIMIT 1
---------- AST ------------
ShowMetrics {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            25..26,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                19..25,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            19..25,
                                        ),
                                        name: "metric",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                26..51,
                            ),
                            value: String(
                                "session_connect_numbers",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show table_functions like 'fuse%' limit 1
---------- Output ---------
SHOW TABLE_FUNCTIONS LIKE 'fuse%' LIMIT 1
---------- AST ------------
ShowTableFunctions {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "fuse%",
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show table_functions where name='fuse_snapshot' limit 1
---------- Output ---------
SHOW TABLE_FUNCTIONS WHERE name = 'fuse_snapshot' LIMIT 1
---------- AST ------------
ShowTableFunctions {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            31..32,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                27..31,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            27..31,
                                        ),
                                        name: "name",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                32..47,
                            ),
                            value: String(
                                "fuse_snapshot",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show indexes like 'test%' limit 1
---------- Output ---------
SHOW INDEXES LIKE 'test%' LIMIT 1
---------- AST ------------
ShowIndexes {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "test%",
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
show indexes where name='test_idx' limit 1
---------- Output ---------
SHOW INDEXES WHERE name = 'test_idx' LIMIT 1
---------- AST ------------
ShowIndexes {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Where {
                    selection: BinaryOp {
                        span: Some(
                            23..24,
                        ),
                        op: Eq,
                        left: ColumnRef {
                            span: Some(
                                19..23,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            19..23,
                                        ),
                                        name: "name",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        right: Literal {
                            span: Some(
                                24..34,
                            ),
                            value: String(
                                "test_idx",
                            ),
                        },
                    },
                },
            ),
            limit: Some(
                1,
            ),
        },
    ),
}


---------- Input ----------
PRESIGN @my_stage
---------- Output ---------
PRESIGN DOWNLOAD @my_stage EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN @my_stage/path/to/dir/
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/path/to/dir/ EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/path/to/dir/",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN @my_stage/path/to/file
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/path/to/file EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/path/to/file",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN @my_stage/my\ file.csv
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/my\ file.csv EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/my file.csv",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN @my_stage/\"file\".csv
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/\"file\".csv EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/\"file\".csv",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN @my_stage/\'file\'.csv
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/\'file\'.csv EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/'file'.csv",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN @my_stage/\\file\\.csv
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/\\file\\.csv EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/\\file\\.csv",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN DOWNLOAD @my_stage/path/to/file
---------- Output ---------
PRESIGN DOWNLOAD @my_stage/path/to/file EXPIRE = 3600
---------- AST ------------
Presign(
    PresignStmt {
        action: Download,
        location: StageLocation(
            "my_stage/path/to/file",
        ),
        expire: 3600s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN UPLOAD @my_stage/path/to/file EXPIRE=7200
---------- Output ---------
PRESIGN UPLOAD @my_stage/path/to/file EXPIRE = 7200
---------- AST ------------
Presign(
    PresignStmt {
        action: Upload,
        location: StageLocation(
            "my_stage/path/to/file",
        ),
        expire: 7200s,
        content_type: None,
    },
)


---------- Input ----------
PRESIGN UPLOAD @my_stage/path/to/file EXPIRE=7200 CONTENT_TYPE='application/octet-stream'
---------- Output ---------
PRESIGN UPLOAD @my_stage/path/to/file EXPIRE = 7200 CONTENT_TYPE = 'application/octet-stream'
---------- AST ------------
Presign(
    PresignStmt {
        action: Upload,
        location: StageLocation(
            "my_stage/path/to/file",
        ),
        expire: 7200s,
        content_type: Some(
            "application/octet-stream",
        ),
    },
)


---------- Input ----------
PRESIGN UPLOAD @my_stage/path/to/file CONTENT_TYPE='application/octet-stream' EXPIRE=7200
---------- Output ---------
PRESIGN UPLOAD @my_stage/path/to/file EXPIRE = 7200 CONTENT_TYPE = 'application/octet-stream'
---------- AST ------------
Presign(
    PresignStmt {
        action: Upload,
        location: StageLocation(
            "my_stage/path/to/file",
        ),
        expire: 7200s,
        content_type: Some(
            "application/octet-stream",
        ),
    },
)


---------- Input ----------
GRANT all ON stage s1 TO a;
---------- Output ---------
GRANT ALL PRIVILEGES ON  STAGE s1 TO USER 'a'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: ALL {
            level: Stage(
                "s1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "a",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT read ON stage s1 TO a;
---------- Output ---------
GRANT Read ON  STAGE s1 TO USER 'a'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Read,
            ],
            level: Stage(
                "s1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "a",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT write ON stage s1 TO a;
---------- Output ---------
GRANT Write ON  STAGE s1 TO USER 'a'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Write,
            ],
            level: Stage(
                "s1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "a",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
REVOKE write ON stage s1 FROM a;
---------- Output ---------
REVOKE Write ON  STAGE s1 FROM USER 'a'@'%'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Write,
            ],
            level: Stage(
                "s1",
            ),
        },
        principal: User(
            UserIdentity {
                username: "a",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT all ON UDF a TO 'test-grant';
---------- Output ---------
GRANT USAGE ON  UDF a TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: UDF(
                "a",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT usage ON UDF a TO 'test-grant';
---------- Output ---------
GRANT USAGE ON  UDF a TO USER 'test-grant'@'%'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: UDF(
                "a",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
REVOKE usage ON UDF a FROM 'test-grant';
---------- Output ---------
REVOKE USAGE ON  UDF a FROM USER 'test-grant'@'%'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: UDF(
                "a",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
REVOKE all ON UDF a FROM 'test-grant';
---------- Output ---------
REVOKE USAGE ON  UDF a FROM USER 'test-grant'@'%'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: UDF(
                "a",
            ),
        },
        principal: User(
            UserIdentity {
                username: "test-grant",
                hostname: "%",
            },
        ),
    },
)


---------- Input ----------
GRANT all ON warehouse a TO role 'test-grant';
---------- Output ---------
GRANT USAGE ON  WAREHOUSE a TO ROLE 'test-grant'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: Warehouse(
                "a",
            ),
        },
        principal: Role(
            "test-grant",
        ),
    },
)


---------- Input ----------
GRANT usage ON warehouse a TO role 'test-grant';
---------- Output ---------
GRANT USAGE ON  WAREHOUSE a TO ROLE 'test-grant'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: Warehouse(
                "a",
            ),
        },
        principal: Role(
            "test-grant",
        ),
    },
)


---------- Input ----------
REVOKE usage ON warehouse a FROM role 'test-grant';
---------- Output ---------
REVOKE USAGE ON  WAREHOUSE a FROM ROLE 'test-grant'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: Warehouse(
                "a",
            ),
        },
        principal: Role(
            "test-grant",
        ),
    },
)


---------- Input ----------
REVOKE all ON warehouse a FROM role 'test-grant';
---------- Output ---------
REVOKE USAGE ON  WAREHOUSE a FROM ROLE 'test-grant'
---------- AST ------------
Revoke(
    RevokeStmt {
        source: Privs {
            privileges: [
                Usage,
            ],
            level: Warehouse(
                "a",
            ),
        },
        principal: Role(
            "test-grant",
        ),
    },
)


---------- Input ----------
SHOW GRANTS ON TABLE db1.tb1;
---------- Output ---------
SHOW GRANTS ON TABLE db1.tb1 
---------- AST ------------
ShowObjectPrivileges(
    ShowObjectPrivilegesStmt {
        object: Table(
            Some(
                "db1",
            ),
            "tb1",
        ),
        show_option: Some(
            ShowOptions {
                show_limit: None,
                limit: None,
            },
        ),
    },
)


---------- Input ----------
SHOW GRANTS ON DATABASE db;
---------- Output ---------
SHOW GRANTS ON DATABASE db 
---------- AST ------------
ShowObjectPrivileges(
    ShowObjectPrivilegesStmt {
        object: Database(
            "db",
        ),
        show_option: Some(
            ShowOptions {
                show_limit: None,
                limit: None,
            },
        ),
    },
)


---------- Input ----------
SHOW GRANTS ON CONNECTION c1;
---------- Output ---------
SHOW GRANTS ON  CONNECTION c1 
---------- AST ------------
ShowObjectPrivileges(
    ShowObjectPrivilegesStmt {
        object: Connection(
            "c1",
        ),
        show_option: Some(
            ShowOptions {
                show_limit: None,
                limit: None,
            },
        ),
    },
)


---------- Input ----------
UPDATE db1.tb1 set a = a + 1, b = 2 WHERE c > 3;
---------- Output ---------
UPDATE db1.tb1 SET a = a + 1, b = 2 WHERE c > 3
---------- AST ------------
Update(
    UpdateStmt {
        hints: None,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    7..10,
                ),
                name: "db1",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                11..14,
            ),
            name: "tb1",
            quote: None,
            ident_type: None,
        },
        table_alias: None,
        update_list: [
            MutationUpdateExpr {
                table: None,
                name: Identifier {
                    span: Some(
                        19..20,
                    ),
                    name: "a",
                    quote: None,
                    ident_type: None,
                },
                expr: BinaryOp {
                    span: Some(
                        25..26,
                    ),
                    op: Plus,
                    left: ColumnRef {
                        span: Some(
                            23..24,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        23..24,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                    right: Literal {
                        span: Some(
                            27..28,
                        ),
                        value: UInt64(
                            1,
                        ),
                    },
                },
            },
            MutationUpdateExpr {
                table: None,
                name: Identifier {
                    span: Some(
                        30..31,
                    ),
                    name: "b",
                    quote: None,
                    ident_type: None,
                },
                expr: Literal {
                    span: Some(
                        34..35,
                    ),
                    value: UInt64(
                        2,
                    ),
                },
            },
        ],
        from: None,
        selection: Some(
            BinaryOp {
                span: Some(
                    44..45,
                ),
                op: Gt,
                left: ColumnRef {
                    span: Some(
                        42..43,
                    ),
                    column: ColumnRef {
                        database: None,
                        table: None,
                        column: Name(
                            Identifier {
                                span: Some(
                                    42..43,
                                ),
                                name: "c",
                                quote: None,
                                ident_type: None,
                            },
                        ),
                    },
                },
                right: Literal {
                    span: Some(
                        46..47,
                    ),
                    value: UInt64(
                        3,
                    ),
                },
            },
        ),
        with: None,
    },
)


---------- Input ----------
select $abc + 3
---------- Output ---------
SELECT getvariable('abc') + 3
---------- AST ------------
Query(
    Query {
        span: Some(
            0..15,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..15,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: BinaryOp {
                            span: Some(
                                12..13,
                            ),
                            op: Plus,
                            left: FunctionCall {
                                span: Some(
                                    7..11,
                                ),
                                func: FunctionCall {
                                    distinct: false,
                                    name: Identifier {
                                        span: Some(
                                            7..11,
                                        ),
                                        name: "getvariable",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    args: [
                                        Literal {
                                            span: Some(
                                                7..11,
                                            ),
                                            value: String(
                                                "abc",
                                            ),
                                        },
                                    ],
                                    params: [],
                                    order_by: [],
                                    window: None,
                                    lambda: None,
                                },
                            },
                            right: Literal {
                                span: Some(
                                    14..15,
                                ),
                                value: UInt64(
                                    3,
                                ),
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select IDENTIFIER($abc)
---------- Output ---------
SELECT IDENTIFIER($abc)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..23,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..23,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                7..23,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            7..23,
                                        ),
                                        name: "abc",
                                        quote: None,
                                        ident_type: Variable,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SET max_threads = 10;
---------- Output ---------
SET SESSION max_threads = 10
---------- AST ------------
SetStmt {
    settings: Settings {
        set_type: SettingsSession,
        identifiers: [
            Identifier {
                span: Some(
                    4..15,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
        ],
        values: Expr(
            [
                Literal {
                    span: Some(
                        18..20,
                    ),
                    value: UInt64(
                        10,
                    ),
                },
            ],
        ),
    },
}


---------- Input ----------
SET max_threads = 10*2;
---------- Output ---------
SET SESSION max_threads = 10 * 2
---------- AST ------------
SetStmt {
    settings: Settings {
        set_type: SettingsSession,
        identifiers: [
            Identifier {
                span: Some(
                    4..15,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
        ],
        values: Expr(
            [
                BinaryOp {
                    span: Some(
                        20..21,
                    ),
                    op: Multiply,
                    left: Literal {
                        span: Some(
                            18..20,
                        ),
                        value: UInt64(
                            10,
                        ),
                    },
                    right: Literal {
                        span: Some(
                            21..22,
                        ),
                        value: UInt64(
                            2,
                        ),
                    },
                },
            ],
        ),
    },
}


---------- Input ----------
SET global (max_threads, max_memory_usage) = (10*2, 10*4);
---------- Output ---------
SET GLOBAL (max_threads, max_memory_usage) = (10 * 2, 10 * 4)
---------- AST ------------
SetStmt {
    settings: Settings {
        set_type: SettingsGlobal,
        identifiers: [
            Identifier {
                span: Some(
                    12..23,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    25..41,
                ),
                name: "max_memory_usage",
                quote: None,
                ident_type: None,
            },
        ],
        values: Expr(
            [
                BinaryOp {
                    span: Some(
                        48..49,
                    ),
                    op: Multiply,
                    left: Literal {
                        span: Some(
                            46..48,
                        ),
                        value: UInt64(
                            10,
                        ),
                    },
                    right: Literal {
                        span: Some(
                            49..50,
                        ),
                        value: UInt64(
                            2,
                        ),
                    },
                },
                BinaryOp {
                    span: Some(
                        54..55,
                    ),
                    op: Multiply,
                    left: Literal {
                        span: Some(
                            52..54,
                        ),
                        value: UInt64(
                            10,
                        ),
                    },
                    right: Literal {
                        span: Some(
                            55..56,
                        ),
                        value: UInt64(
                            4,
                        ),
                    },
                },
            ],
        ),
    },
}


---------- Input ----------
UNSET max_threads;
---------- Output ---------
UNSET SESSION max_threads
---------- AST ------------
UnSetStmt {
    settings: Settings {
        set_type: SettingsSession,
        identifiers: [
            Identifier {
                span: Some(
                    6..17,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
        ],
        values: None,
    },
}


---------- Input ----------
UNSET session max_threads;
---------- Output ---------
UNSET SESSION max_threads
---------- AST ------------
UnSetStmt {
    settings: Settings {
        set_type: SettingsSession,
        identifiers: [
            Identifier {
                span: Some(
                    14..25,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
        ],
        values: None,
    },
}


---------- Input ----------
UNSET (max_threads, sql_dialect);
---------- Output ---------
UNSET SESSION (max_threads, sql_dialect)
---------- AST ------------
UnSetStmt {
    settings: Settings {
        set_type: SettingsSession,
        identifiers: [
            Identifier {
                span: Some(
                    7..18,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    20..31,
                ),
                name: "sql_dialect",
                quote: None,
                ident_type: None,
            },
        ],
        values: None,
    },
}


---------- Input ----------
UNSET session (max_threads, sql_dialect);
---------- Output ---------
UNSET SESSION (max_threads, sql_dialect)
---------- AST ------------
UnSetStmt {
    settings: Settings {
        set_type: SettingsSession,
        identifiers: [
            Identifier {
                span: Some(
                    15..26,
                ),
                name: "max_threads",
                quote: None,
                ident_type: None,
            },
            Identifier {
                span: Some(
                    28..39,
                ),
                name: "sql_dialect",
                quote: None,
                ident_type: None,
            },
        ],
        values: None,
    },
}


---------- Input ----------
SET variable a = 3
---------- Output ---------
SET VARIABLE a = 3
---------- AST ------------
SetStmt {
    settings: Settings {
        set_type: Variable,
        identifiers: [
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ],
        values: Expr(
            [
                Literal {
                    span: Some(
                        17..18,
                    ),
                    value: UInt64(
                        3,
                    ),
                },
            ],
        ),
    },
}


---------- Input ----------
show variables
---------- Output ---------
SHOW VARIABLES 
---------- AST ------------
ShowVariables {
    show_options: Some(
        ShowOptions {
            show_limit: None,
            limit: None,
        },
    ),
}


---------- Input ----------
show variables like 'v%'
---------- Output ---------
SHOW VARIABLES LIKE 'v%'
---------- AST ------------
ShowVariables {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "v%",
                },
            ),
            limit: None,
        },
    ),
}


---------- Input ----------
SET variable a = select 3
---------- Output ---------
SET VARIABLE a = SELECT 3
---------- AST ------------
SetStmt {
    settings: Settings {
        set_type: Variable,
        identifiers: [
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ],
        values: Query(
            Query {
                span: Some(
                    17..25,
                ),
                with: None,
                body: Select(
                    SelectStmt {
                        span: Some(
                            17..25,
                        ),
                        hints: None,
                        distinct: false,
                        top_n: None,
                        select_list: [
                            AliasedExpr {
                                expr: Literal {
                                    span: Some(
                                        24..25,
                                    ),
                                    value: UInt64(
                                        3,
                                    ),
                                },
                                alias: None,
                            },
                        ],
                        from: [],
                        selection: None,
                        group_by: None,
                        having: None,
                        window_list: None,
                        qualify: None,
                    },
                ),
                order_by: [],
                limit: [],
                offset: None,
                ignore_result: false,
            },
        ),
    },
}


---------- Input ----------
SET variable a = (select max(number) from numbers(10))
---------- Output ---------
SET VARIABLE a = (SELECT max(number) FROM numbers(10))
---------- AST ------------
SetStmt {
    settings: Settings {
        set_type: Variable,
        identifiers: [
            Identifier {
                span: Some(
                    13..14,
                ),
                name: "a",
                quote: None,
                ident_type: None,
            },
        ],
        values: Expr(
            [
                Subquery {
                    span: Some(
                        17..54,
                    ),
                    modifier: None,
                    subquery: Query {
                        span: Some(
                            18..53,
                        ),
                        with: None,
                        body: Select(
                            SelectStmt {
                                span: Some(
                                    18..53,
                                ),
                                hints: None,
                                distinct: false,
                                top_n: None,
                                select_list: [
                                    AliasedExpr {
                                        expr: FunctionCall {
                                            span: Some(
                                                25..36,
                                            ),
                                            func: FunctionCall {
                                                distinct: false,
                                                name: Identifier {
                                                    span: Some(
                                                        25..28,
                                                    ),
                                                    name: "max",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                                args: [
                                                    ColumnRef {
                                                        span: Some(
                                                            29..35,
                                                        ),
                                                        column: ColumnRef {
                                                            database: None,
                                                            table: None,
                                                            column: Name(
                                                                Identifier {
                                                                    span: Some(
                                                                        29..35,
                                                                    ),
                                                                    name: "number",
                                                                    quote: None,
                                                                    ident_type: None,
                                                                },
                                                            ),
                                                        },
                                                    },
                                                ],
                                                params: [],
                                                order_by: [],
                                                window: None,
                                                lambda: None,
                                            },
                                        },
                                        alias: None,
                                    },
                                ],
                                from: [
                                    TableFunction {
                                        span: Some(
                                            42..53,
                                        ),
                                        lateral: false,
                                        name: Identifier {
                                            span: Some(
                                                42..49,
                                            ),
                                            name: "numbers",
                                            quote: None,
                                            ident_type: None,
                                        },
                                        params: [
                                            Literal {
                                                span: Some(
                                                    50..52,
                                                ),
                                                value: UInt64(
                                                    10,
                                                ),
                                            },
                                        ],
                                        named_params: [],
                                        alias: None,
                                        sample: None,
                                    },
                                ],
                                selection: None,
                                group_by: None,
                                having: None,
                                window_list: None,
                                qualify: None,
                            },
                        ),
                        order_by: [],
                        limit: [],
                        offset: None,
                        ignore_result: false,
                    },
                },
            ],
        ),
    },
}


---------- Input ----------
select $1 FROM '@my_stage/my data/'
---------- Output ---------
SELECT $1 FROM '@my_stage/my data/'
---------- AST ------------
Query(
    Query {
        span: Some(
            0..35,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..35,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                7..9,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Position(
                                    ColumnPosition {
                                        span: Some(
                                            7..9,
                                        ),
                                        pos: 1,
                                        name: "$1",
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Location {
                        span: Some(
                            15..35,
                        ),
                        location: Stage(
                            "my_stage/my data/",
                        ),
                        options: SelectStageOptions {
                            files: None,
                            pattern: None,
                            file_format: None,
                            connection: {},
                            case_sensitive: None,
                        },
                        alias: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT t.c1 FROM @stage1/dir/file
    ( file_format => 'PARQUET', FILES => ('file1', 'file2')) t;
---------- Output ---------
SELECT t.c1 FROM '@stage1/dir/file' ( FILES => ('file1', 'file2'), FILE_FORMAT => 'PARQUET', ) AS t
---------- AST ------------
Query(
    Query {
        span: Some(
            0..96,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..96,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                7..8,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            7..8,
                                        ),
                                        name: "t",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            9..11,
                                        ),
                                        name: "c1",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Location {
                        span: Some(
                            17..96,
                        ),
                        location: Stage(
                            "stage1/dir/file",
                        ),
                        options: SelectStageOptions {
                            files: Some(
                                [
                                    "file1",
                                    "file2",
                                ],
                            ),
                            pattern: None,
                            file_format: Some(
                                "PARQUET",
                            ),
                            connection: {},
                            case_sensitive: None,
                        },
                        alias: Some(
                            TableAlias {
                                name: Identifier {
                                    span: Some(
                                        95..96,
                                    ),
                                    name: "t",
                                    quote: None,
                                    ident_type: None,
                                },
                                columns: [],
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
select table0.c1, table1.c2 from
    @stage1/dir/file ( FILE_FORMAT => 'parquet', FILES => ('file1', 'file2')) table0
    left join table1;
---------- Output ---------
SELECT table0.c1, table1.c2 FROM '@stage1/dir/file' ( FILES => ('file1', 'file2'), FILE_FORMAT => 'parquet', ) AS table0 LEFT OUTER JOIN table1
---------- AST ------------
Query(
    Query {
        span: Some(
            0..138,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..138,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                7..13,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            7..13,
                                        ),
                                        name: "table0",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            14..16,
                                        ),
                                        name: "c1",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                18..24,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: Some(
                                    Identifier {
                                        span: Some(
                                            18..24,
                                        ),
                                        name: "table1",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            25..27,
                                        ),
                                        name: "c2",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Join {
                        span: Some(
                            122..131,
                        ),
                        join: Join {
                            op: LeftOuter,
                            condition: None,
                            left: Location {
                                span: Some(
                                    37..117,
                                ),
                                location: Stage(
                                    "stage1/dir/file",
                                ),
                                options: SelectStageOptions {
                                    files: Some(
                                        [
                                            "file1",
                                            "file2",
                                        ],
                                    ),
                                    pattern: None,
                                    file_format: Some(
                                        "parquet",
                                    ),
                                    connection: {},
                                    case_sensitive: None,
                                },
                                alias: Some(
                                    TableAlias {
                                        name: Identifier {
                                            span: Some(
                                                111..117,
                                            ),
                                            name: "table0",
                                            quote: None,
                                            ident_type: None,
                                        },
                                        columns: [],
                                    },
                                ),
                            },
                            right: Table {
                                span: Some(
                                    132..138,
                                ),
                                catalog: None,
                                database: None,
                                table: Identifier {
                                    span: Some(
                                        132..138,
                                    ),
                                    name: "table1",
                                    quote: None,
                                    ident_type: None,
                                },
                                alias: None,
                                temporal: None,
                                with_options: None,
                                pivot: None,
                                unpivot: None,
                                sample: None,
                            },
                        },
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT c1 FROM 's3://test/bucket' (PATTERN => '*.parquet', connection => (ENDPOINT_URL = 'xxx')) t;
---------- Output ---------
SELECT c1 FROM 's3://test/bucket' ( PATTERN => '*.parquet', CONNECTION => (endpoint_url = 'xxx' ) ) AS t
---------- AST ------------
Query(
    Query {
        span: Some(
            0..98,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..98,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                7..9,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            7..9,
                                        ),
                                        name: "c1",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Location {
                        span: Some(
                            15..98,
                        ),
                        location: Uri(
                            UriLocation {
                                protocol: "s3",
                                name: "test",
                                path: "/bucket",
                                connection: Connection {
                                    visited_keys: {},
                                    conns: {},
                                },
                            },
                        ),
                        options: SelectStageOptions {
                            files: None,
                            pattern: Some(
                                Literal(
                                    "*.parquet",
                                ),
                            ),
                            file_format: None,
                            connection: {
                                "endpoint_url": "xxx",
                            },
                            case_sensitive: None,
                        },
                        alias: Some(
                            TableAlias {
                                name: Identifier {
                                    span: Some(
                                        97..98,
                                    ),
                                    name: "t",
                                    quote: None,
                                    ident_type: None,
                                },
                                columns: [],
                            },
                        ),
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
CREATE FILE FORMAT my_csv
    type = CSV field_delimiter = ',' record_delimiter = '\n' skip_header = 1;
---------- Output ---------
CREATE FILE FORMAT my_csv field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV
---------- AST ------------
CreateFileFormat {
    create_option: Create,
    name: "my_csv",
    file_format_options: FileFormatOptions {
        options: {
            "field_delimiter": String(
                ",",
            ),
            "record_delimiter": String(
                "\n",
            ),
            "skip_header": U64(
                1,
            ),
            "type": Keyword(
                "CSV",
            ),
        },
    },
}


---------- Input ----------
CREATE OR REPLACE FILE FORMAT my_csv
    type = CSV field_delimiter = ',' record_delimiter = '\n' skip_header = 1;
---------- Output ---------
CREATE OR REPLACE FILE FORMAT my_csv field_delimiter = ',', record_delimiter = '\n', skip_header = 1, type = CSV
---------- AST ------------
CreateFileFormat {
    create_option: CreateOrReplace,
    name: "my_csv",
    file_format_options: FileFormatOptions {
        options: {
            "field_delimiter": String(
                ",",
            ),
            "record_delimiter": String(
                "\n",
            ),
            "skip_header": U64(
                1,
            ),
            "type": Keyword(
                "CSV",
            ),
        },
    },
}


---------- Input ----------
SHOW FILE FORMATS
---------- Output ---------
SHOW FILE FORMATS
---------- AST ------------
ShowFileFormats


---------- Input ----------
DROP FILE FORMAT my_csv
---------- Output ---------
DROP FILE FORMAT my_csv
---------- AST ------------
DropFileFormat {
    if_exists: false,
    name: "my_csv",
}


---------- Input ----------
SELECT * FROM t GROUP BY all
---------- Output ---------
SELECT * FROM t GROUP BY ALL
---------- AST ------------
Query(
    Query {
        span: Some(
            0..28,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..28,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    All,
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY a, b, c, d
---------- Output ---------
SELECT * FROM t GROUP BY a, b, c, d
---------- AST ------------
Query(
    Query {
        span: Some(
            0..35,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..35,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    Normal(
                        [
                            ColumnRef {
                                span: Some(
                                    25..26,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                25..26,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    28..29,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                28..29,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    31..32,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                31..32,
                                            ),
                                            name: "c",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    34..35,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                34..35,
                                            ),
                                            name: "d",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY GROUPING SETS (a, b, c, d)
---------- Output ---------
SELECT * FROM t GROUP BY GROUPING SETS ((a), (b), (c), (d))
---------- AST ------------
Query(
    Query {
        span: Some(
            0..51,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..51,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    GroupingSets(
                        [
                            [
                                ColumnRef {
                                    span: Some(
                                        40..41,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    40..41,
                                                ),
                                                name: "a",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        43..44,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    43..44,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        46..47,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    46..47,
                                                ),
                                                name: "c",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        49..50,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    49..50,
                                                ),
                                                name: "d",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY GROUPING SETS (a, b, (c, d))
---------- Output ---------
SELECT * FROM t GROUP BY GROUPING SETS ((a), (b), (c, d))
---------- AST ------------
Query(
    Query {
        span: Some(
            0..53,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..53,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    GroupingSets(
                        [
                            [
                                ColumnRef {
                                    span: Some(
                                        40..41,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    40..41,
                                                ),
                                                name: "a",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        43..44,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    43..44,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        47..48,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    47..48,
                                                ),
                                                name: "c",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                ColumnRef {
                                    span: Some(
                                        50..51,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    50..51,
                                                ),
                                                name: "d",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY GROUPING SETS ((a, b), (c), (d, e))
---------- Output ---------
SELECT * FROM t GROUP BY GROUPING SETS ((a, b), (c), (d, e))
---------- AST ------------
Query(
    Query {
        span: Some(
            0..60,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..60,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    GroupingSets(
                        [
                            [
                                ColumnRef {
                                    span: Some(
                                        41..42,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    41..42,
                                                ),
                                                name: "a",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                ColumnRef {
                                    span: Some(
                                        44..45,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    44..45,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        49..50,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    49..50,
                                                ),
                                                name: "c",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [
                                ColumnRef {
                                    span: Some(
                                        54..55,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    54..55,
                                                ),
                                                name: "d",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                ColumnRef {
                                    span: Some(
                                        57..58,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    57..58,
                                                ),
                                                name: "e",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY GROUPING SETS ((a, b), (), (d, e))
---------- Output ---------
SELECT * FROM t GROUP BY GROUPING SETS ((a, b), (), (d, e))
---------- AST ------------
Query(
    Query {
        span: Some(
            0..59,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..59,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    GroupingSets(
                        [
                            [
                                ColumnRef {
                                    span: Some(
                                        41..42,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    41..42,
                                                ),
                                                name: "a",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                ColumnRef {
                                    span: Some(
                                        44..45,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    44..45,
                                                ),
                                                name: "b",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                            [],
                            [
                                ColumnRef {
                                    span: Some(
                                        53..54,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    53..54,
                                                ),
                                                name: "d",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                ColumnRef {
                                    span: Some(
                                        56..57,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    56..57,
                                                ),
                                                name: "e",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY CUBE (a, b, c)
---------- Output ---------
SELECT * FROM t GROUP BY CUBE (a, b, c)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..39,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..39,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    Cube(
                        [
                            ColumnRef {
                                span: Some(
                                    31..32,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                31..32,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    34..35,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                34..35,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    37..38,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                37..38,
                                            ),
                                            name: "c",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY ROLLUP (a, b, c)
---------- Output ---------
SELECT * FROM t GROUP BY ROLLUP (a, b, c)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..41,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..41,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    Rollup(
                        [
                            ColumnRef {
                                span: Some(
                                    33..34,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                33..34,
                                            ),
                                            name: "a",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    36..37,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                36..37,
                                            ),
                                            name: "b",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            ColumnRef {
                                span: Some(
                                    39..40,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                39..40,
                                            ),
                                            name: "c",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY a, ROLLUP (b, c)
---------- Output ---------
SELECT * FROM t GROUP BY a, ROLLUP (b, c)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..41,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..41,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    Combined(
                        [
                            Normal(
                                [
                                    ColumnRef {
                                        span: Some(
                                            25..26,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        25..26,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                            ),
                            Rollup(
                                [
                                    ColumnRef {
                                        span: Some(
                                            36..37,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        36..37,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    ColumnRef {
                                        span: Some(
                                            39..40,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        39..40,
                                                    ),
                                                    name: "c",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                            ),
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT * FROM t GROUP BY GROUPING SETS ((a, b)), a, ROLLUP (b, c)
---------- Output ---------
SELECT * FROM t GROUP BY GROUPING SETS ((a, b)), a, ROLLUP (b, c)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..65,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..65,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    7..8,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            14..15,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                14..15,
                            ),
                            name: "t",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: Some(
                    Combined(
                        [
                            GroupingSets(
                                [
                                    [
                                        ColumnRef {
                                            span: Some(
                                                41..42,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            41..42,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                        ColumnRef {
                                            span: Some(
                                                44..45,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            44..45,
                                                        ),
                                                        name: "b",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    ],
                                ],
                            ),
                            Normal(
                                [
                                    ColumnRef {
                                        span: Some(
                                            49..50,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        49..50,
                                                    ),
                                                    name: "a",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                            ),
                            Rollup(
                                [
                                    ColumnRef {
                                        span: Some(
                                            60..61,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        60..61,
                                                    ),
                                                    name: "b",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                    ColumnRef {
                                        span: Some(
                                            63..64,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        63..64,
                                                    ),
                                                    name: "c",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                            ),
                        ],
                    ),
                ),
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
CREATE MASKING POLICY email_mask AS (val STRING) RETURNS STRING -> CASE WHEN current_role() IN ('ANALYST') THEN VAL ELSE '*********'END comment = 'this is a masking policy'
---------- Output ---------
CREATE MASKING POLICY email_mask AS (val STRING) RETURNS STRING -> CASE WHEN current_role() IN('ANALYST') THEN VAL ELSE '*********' END COMMENT = 'this is a masking policy'
---------- AST ------------
CreateDatamaskPolicy(
    CreateDatamaskPolicyStmt {
        create_option: Create,
        name: "email_mask",
        policy: DataMaskPolicy {
            args: [
                DataMaskArg {
                    arg_name: "val",
                    arg_type: String,
                },
            ],
            return_type: String,
            body: Case {
                span: Some(
                    67..135,
                ),
                operand: None,
                conditions: [
                    InList {
                        span: Some(
                            92..106,
                        ),
                        expr: FunctionCall {
                            span: Some(
                                77..91,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        77..89,
                                    ),
                                    name: "current_role",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        list: [
                            Literal {
                                span: Some(
                                    96..105,
                                ),
                                value: String(
                                    "ANALYST",
                                ),
                            },
                        ],
                        not: false,
                    },
                ],
                results: [
                    ColumnRef {
                        span: Some(
                            112..115,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        112..115,
                                    ),
                                    name: "VAL",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ],
                else_result: Some(
                    Literal {
                        span: Some(
                            121..132,
                        ),
                        value: String(
                            "*********",
                        ),
                    },
                ),
            },
            comment: Some(
                "this is a masking policy",
            ),
        },
    },
)


---------- Input ----------
CREATE OR REPLACE MASKING POLICY email_mask AS (val STRING) RETURNS STRING -> CASE WHEN current_role() IN ('ANALYST') THEN VAL ELSE '*********'END comment = 'this is a masking policy'
---------- Output ---------
CREATE OR REPLACE MASKING POLICY email_mask AS (val STRING) RETURNS STRING -> CASE WHEN current_role() IN('ANALYST') THEN VAL ELSE '*********' END COMMENT = 'this is a masking policy'
---------- AST ------------
CreateDatamaskPolicy(
    CreateDatamaskPolicyStmt {
        create_option: CreateOrReplace,
        name: "email_mask",
        policy: DataMaskPolicy {
            args: [
                DataMaskArg {
                    arg_name: "val",
                    arg_type: String,
                },
            ],
            return_type: String,
            body: Case {
                span: Some(
                    78..146,
                ),
                operand: None,
                conditions: [
                    InList {
                        span: Some(
                            103..117,
                        ),
                        expr: FunctionCall {
                            span: Some(
                                88..102,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        88..100,
                                    ),
                                    name: "current_role",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                        list: [
                            Literal {
                                span: Some(
                                    107..116,
                                ),
                                value: String(
                                    "ANALYST",
                                ),
                            },
                        ],
                        not: false,
                    },
                ],
                results: [
                    ColumnRef {
                        span: Some(
                            123..126,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        123..126,
                                    ),
                                    name: "VAL",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ],
                else_result: Some(
                    Literal {
                        span: Some(
                            132..143,
                        ),
                        value: String(
                            "*********",
                        ),
                    },
                ),
            },
            comment: Some(
                "this is a masking policy",
            ),
        },
    },
)


---------- Input ----------
DESC MASKING POLICY email_mask
---------- Output ---------
DESCRIBE MASKING POLICY email_mask
---------- AST ------------
DescDatamaskPolicy(
    DescDatamaskPolicyStmt {
        name: "email_mask",
    },
)


---------- Input ----------
DROP MASKING POLICY IF EXISTS email_mask
---------- Output ---------
DROP MASKING POLICY IF EXISTS email_mask
---------- AST ------------
DropDatamaskPolicy(
    DropDatamaskPolicyStmt {
        if_exists: true,
        name: "email_mask",
    },
)


---------- Input ----------
REFRESH VIRTUAL COLUMN FOR t
---------- Output ---------
REFRESH VIRTUAL COLUMN FOR t
---------- AST ------------
RefreshVirtualColumn(
    RefreshVirtualColumnStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                27..28,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
CREATE NETWORK POLICY mypolicy ALLOWED_IP_LIST=('192.168.10.0/24') BLOCKED_IP_LIST=('192.168.10.99') COMMENT='test'
---------- Output ---------
CREATE NETWORK POLICY mypolicy ALLOWED_IP_LIST = ('192.168.10.0/24') BLOCKED_IP_LIST = ('192.168.10.99') COMMENT = 'test'
---------- AST ------------
CreateNetworkPolicy(
    CreateNetworkPolicyStmt {
        create_option: Create,
        name: "mypolicy",
        allowed_ip_list: [
            "192.168.10.0/24",
        ],
        blocked_ip_list: Some(
            [
                "192.168.10.99",
            ],
        ),
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
CREATE OR REPLACE NETWORK POLICY mypolicy ALLOWED_IP_LIST=('192.168.10.0/24') BLOCKED_IP_LIST=('192.168.10.99') COMMENT='test'
---------- Output ---------
CREATE OR REPLACE NETWORK POLICY mypolicy ALLOWED_IP_LIST = ('192.168.10.0/24') BLOCKED_IP_LIST = ('192.168.10.99') COMMENT = 'test'
---------- AST ------------
CreateNetworkPolicy(
    CreateNetworkPolicyStmt {
        create_option: CreateOrReplace,
        name: "mypolicy",
        allowed_ip_list: [
            "192.168.10.0/24",
        ],
        blocked_ip_list: Some(
            [
                "192.168.10.99",
            ],
        ),
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
ALTER NETWORK POLICY mypolicy SET ALLOWED_IP_LIST=('192.168.10.0/24','192.168.255.1') BLOCKED_IP_LIST=('192.168.1.99') COMMENT='test'
---------- Output ---------
ALTER NETWORK POLICY mypolicy SET  ALLOWED_IP_LIST = ('192.168.10.0/24','192.168.255.1') BLOCKED_IP_LIST = ('192.168.1.99') COMMENT = 'test'
---------- AST ------------
AlterNetworkPolicy(
    AlterNetworkPolicyStmt {
        if_exists: false,
        name: "mypolicy",
        allowed_ip_list: Some(
            [
                "192.168.10.0/24",
                "192.168.255.1",
            ],
        ),
        blocked_ip_list: Some(
            [
                "192.168.1.99",
            ],
        ),
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
CREATE OR REPLACE DYNAMIC TABLE db.MyDynamic LIKE t
    TARGET_LAG = 10 SECOND
    WAREHOUSE = 'MyWarehouse'
    REFRESH_MODE = FULL
    INITIALIZE = ON_CREATE
    COMMENT = 'This is test dynamic table'
AS
    SELECT * FROM t
---------- Output ---------
CREATE OR REPLACE DYNAMIC TABLE db.MyDynamic LIKE t TARGET_LAG = 10 SECOND WAREHOUSE = 'MyWarehouse' REFRESH_MODE = FULL INITIALIZE = ON_CREATE comment = 'This is test dynamic table' AS SELECT * FROM t
---------- AST ------------
CreateDynamicTable(
    CreateDynamicTableStmt {
        create_option: CreateOrReplace,
        transient: false,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    32..34,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                35..44,
            ),
            name: "MyDynamic",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Like {
                catalog: None,
                database: None,
                table: Identifier {
                    span: Some(
                        50..51,
                    ),
                    name: "t",
                    quote: None,
                    ident_type: None,
                },
            },
        ),
        cluster_by: None,
        target_lag: IntervalSecs(
            10,
        ),
        warehouse_opts: WarehouseOptions {
            warehouse: Some(
                "MyWarehouse",
            ),
        },
        refresh_mode: Full,
        initialize: OnCreate,
        table_options: {
            "comment": "This is test dynamic table",
        },
        as_query: Query {
            span: Some(
                210..225,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        210..225,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        StarColumns {
                            qualified: [
                                Star(
                                    Some(
                                        217..218,
                                    ),
                                ),
                            ],
                            column_filter: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                224..225,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    224..225,
                                ),
                                name: "t",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
CREATE DYNAMIC TABLE IF NOT EXISTS db.MyDynamic (a int, b string)
    TARGET_LAG = 10 MINUTE
    WAREHOUSE = 'MyWarehouse'
    REFRESH_MODE = INCREMENTAL
    INITIALIZE = ON_SCHEDULE
    COMMENT = 'This is test dynamic table'
AS
    SELECT * FROM t
---------- Output ---------
CREATE DYNAMIC TABLE IF NOT EXISTS db.MyDynamic (a Int32, b STRING) TARGET_LAG = 600 SECOND WAREHOUSE = 'MyWarehouse' REFRESH_MODE = INCREMENTAL INITIALIZE = ON_SCHEDULE comment = 'This is test dynamic table' AS SELECT * FROM t
---------- AST ------------
CreateDynamicTable(
    CreateDynamicTableStmt {
        create_option: CreateIfNotExists,
        transient: false,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    35..37,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                38..47,
            ),
            name: "MyDynamic",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                49..50,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                56..57,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        cluster_by: None,
        target_lag: IntervalSecs(
            600,
        ),
        warehouse_opts: WarehouseOptions {
            warehouse: Some(
                "MyWarehouse",
            ),
        },
        refresh_mode: Incremental,
        initialize: OnSchedule,
        table_options: {
            "comment": "This is test dynamic table",
        },
        as_query: Query {
            span: Some(
                233..248,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        233..248,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        StarColumns {
                            qualified: [
                                Star(
                                    Some(
                                        240..241,
                                    ),
                                ),
                            ],
                            column_filter: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                247..248,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    247..248,
                                ),
                                name: "t",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
CREATE DYNAMIC TABLE db.MyDynamic (a int, b string)
    CLUSTER BY (a)
    TARGET_LAG = 10 HOUR
    REFRESH_MODE = AUTO
    COMMENT = 'This is test dynamic table'
    STORAGE_FORMAT = 'native'
AS
    SELECT c, d FROM t
---------- Output ---------
CREATE DYNAMIC TABLE db.MyDynamic (a Int32, b STRING) CLUSTER BY LINEAR(a) TARGET_LAG = 36000 SECOND REFRESH_MODE = AUTO INITIALIZE = ON_CREATE comment = 'This is test dynamic table' storage_format = 'native' AS SELECT c, d FROM t
---------- AST ------------
CreateDynamicTable(
    CreateDynamicTableStmt {
        create_option: Create,
        transient: false,
        catalog: None,
        database: Some(
            Identifier {
                span: Some(
                    21..23,
                ),
                name: "db",
                quote: None,
                ident_type: None,
            },
        ),
        table: Identifier {
            span: Some(
                24..33,
            ),
            name: "MyDynamic",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                35..36,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                42..43,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        cluster_by: Some(
            ClusterOption {
                cluster_type: Linear,
                cluster_exprs: [
                    ColumnRef {
                        span: Some(
                            68..69,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        68..69,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ],
            },
        ),
        target_lag: IntervalSecs(
            36000,
        ),
        warehouse_opts: WarehouseOptions {
            warehouse: None,
        },
        refresh_mode: Auto,
        initialize: OnCreate,
        table_options: {
            "comment": "This is test dynamic table",
            "storage_format": "native",
        },
        as_query: Query {
            span: Some(
                200..218,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        200..218,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    207..208,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                207..208,
                                            ),
                                            name: "c",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    210..211,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                210..211,
                                            ),
                                            name: "d",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                217..218,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    217..218,
                                ),
                                name: "t",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: None,
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
CREATE TRANSIENT DYNAMIC TABLE IF NOT EXISTS MyDynamic (a int, b string)
    CLUSTER BY (a)
    TARGET_LAG = 10 DAY
AS
    SELECT avg(a), d FROM t GROUP BY d
---------- Output ---------
CREATE TRANSIENT DYNAMIC TABLE IF NOT EXISTS MyDynamic (a Int32, b STRING) CLUSTER BY LINEAR(a) TARGET_LAG = 864000 SECOND REFRESH_MODE = AUTO INITIALIZE = ON_CREATE AS SELECT avg(a), d FROM t GROUP BY d
---------- AST ------------
CreateDynamicTable(
    CreateDynamicTableStmt {
        create_option: CreateIfNotExists,
        transient: true,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                45..54,
            ),
            name: "MyDynamic",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                56..57,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                63..64,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        cluster_by: Some(
            ClusterOption {
                cluster_type: Linear,
                cluster_exprs: [
                    ColumnRef {
                        span: Some(
                            89..90,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        89..90,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ],
            },
        ),
        target_lag: IntervalSecs(
            864000,
        ),
        warehouse_opts: WarehouseOptions {
            warehouse: None,
        },
        refresh_mode: Auto,
        initialize: OnCreate,
        table_options: {},
        as_query: Query {
            span: Some(
                123..157,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        123..157,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: FunctionCall {
                                span: Some(
                                    130..136,
                                ),
                                func: FunctionCall {
                                    distinct: false,
                                    name: Identifier {
                                        span: Some(
                                            130..133,
                                        ),
                                        name: "avg",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    args: [
                                        ColumnRef {
                                            span: Some(
                                                134..135,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            134..135,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    ],
                                    params: [],
                                    order_by: [],
                                    window: None,
                                    lambda: None,
                                },
                            },
                            alias: None,
                        },
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    138..139,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                138..139,
                                            ),
                                            name: "d",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                145..146,
                            ),
                            catalog: None,
                            database: None,
                            table: Identifier {
                                span: Some(
                                    145..146,
                                ),
                                name: "t",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: Some(
                        Normal(
                            [
                                ColumnRef {
                                    span: Some(
                                        156..157,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    156..157,
                                                ),
                                                name: "d",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ),
                    ),
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
CREATE TRANSIENT DYNAMIC TABLE IF NOT EXISTS MyDynamic (a int, b string)
    CLUSTER BY (a)
    REFRESH_MODE = INCREMENTAL
    TARGET_LAG = DOWNSTREAM
AS
    SELECT avg(a), d FROM db.t GROUP BY d
---------- Output ---------
CREATE TRANSIENT DYNAMIC TABLE IF NOT EXISTS MyDynamic (a Int32, b STRING) CLUSTER BY LINEAR(a) TARGET_LAG = DOWNSTREAM REFRESH_MODE = INCREMENTAL INITIALIZE = ON_CREATE AS SELECT avg(a), d FROM db.t GROUP BY d
---------- AST ------------
CreateDynamicTable(
    CreateDynamicTableStmt {
        create_option: CreateIfNotExists,
        transient: true,
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                45..54,
            ),
            name: "MyDynamic",
            quote: None,
            ident_type: None,
        },
        source: Some(
            Columns {
                columns: [
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                56..57,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: Int32,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                    ColumnDefinition {
                        name: Identifier {
                            span: Some(
                                63..64,
                            ),
                            name: "b",
                            quote: None,
                            ident_type: None,
                        },
                        data_type: String,
                        expr: None,
                        check: None,
                        comment: None,
                    },
                ],
                opt_table_indexes: None,
                opt_column_constraints: None,
                opt_table_constraints: None,
            },
        ),
        cluster_by: Some(
            ClusterOption {
                cluster_type: Linear,
                cluster_exprs: [
                    ColumnRef {
                        span: Some(
                            89..90,
                        ),
                        column: ColumnRef {
                            database: None,
                            table: None,
                            column: Name(
                                Identifier {
                                    span: Some(
                                        89..90,
                                    ),
                                    name: "a",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                        },
                    },
                ],
            },
        ),
        target_lag: Downstream,
        warehouse_opts: WarehouseOptions {
            warehouse: None,
        },
        refresh_mode: Incremental,
        initialize: OnCreate,
        table_options: {},
        as_query: Query {
            span: Some(
                158..195,
            ),
            with: None,
            body: Select(
                SelectStmt {
                    span: Some(
                        158..195,
                    ),
                    hints: None,
                    distinct: false,
                    top_n: None,
                    select_list: [
                        AliasedExpr {
                            expr: FunctionCall {
                                span: Some(
                                    165..171,
                                ),
                                func: FunctionCall {
                                    distinct: false,
                                    name: Identifier {
                                        span: Some(
                                            165..168,
                                        ),
                                        name: "avg",
                                        quote: None,
                                        ident_type: None,
                                    },
                                    args: [
                                        ColumnRef {
                                            span: Some(
                                                169..170,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            169..170,
                                                        ),
                                                        name: "a",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                    ],
                                    params: [],
                                    order_by: [],
                                    window: None,
                                    lambda: None,
                                },
                            },
                            alias: None,
                        },
                        AliasedExpr {
                            expr: ColumnRef {
                                span: Some(
                                    173..174,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                173..174,
                                            ),
                                            name: "d",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            alias: None,
                        },
                    ],
                    from: [
                        Table {
                            span: Some(
                                180..184,
                            ),
                            catalog: None,
                            database: Some(
                                Identifier {
                                    span: Some(
                                        180..182,
                                    ),
                                    name: "db",
                                    quote: None,
                                    ident_type: None,
                                },
                            ),
                            table: Identifier {
                                span: Some(
                                    183..184,
                                ),
                                name: "t",
                                quote: None,
                                ident_type: None,
                            },
                            alias: None,
                            temporal: None,
                            with_options: None,
                            pivot: None,
                            unpivot: None,
                            sample: None,
                        },
                    ],
                    selection: None,
                    group_by: Some(
                        Normal(
                            [
                                ColumnRef {
                                    span: Some(
                                        194..195,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    194..195,
                                                ),
                                                name: "d",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                            ],
                        ),
                    ),
                    having: None,
                    window_list: None,
                    qualify: None,
                },
            ),
            order_by: [],
            limit: [],
            offset: None,
            ignore_result: false,
        },
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 15 MINUTE SUSPEND_TASK_AFTER_NUM_FAILURES = 3 ERROR_INTEGRATION = 'notification_name' COMMENT = 'This is test task 1' DATABASE = 'target', TIMEZONE = 'America/Los Angeles' AS SELECT * FROM MyTable1
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 900 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 3 ERROR_INTEGRATION = 'notification_name' COMMENTS = 'This is test task 1' database = 'target', timezone = 'America/Los Angeles' AS SELECT * FROM MyTable1
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: Some(
            "MyWarehouse",
        ),
        schedule_opts: Some(
            IntervalSecs(
                900,
                0,
            ),
        ),
        session_parameters: {
            "database": "target",
            "timezone": "America/Los Angeles",
        },
        suspend_task_after_num_failures: Some(
            3,
        ),
        error_integration: Some(
            "notification_name",
        ),
        comments: Some(
            "This is test task 1",
        ),
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "SELECT * FROM MyTable1",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 15 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 3 COMMENT = 'This is test task 1' AS SELECT * FROM MyTable1
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 15 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 3 COMMENTS = 'This is test task 1' AS SELECT * FROM MyTable1
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: Some(
            "MyWarehouse",
        ),
        schedule_opts: Some(
            IntervalSecs(
                15,
                0,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: Some(
            3,
        ),
        error_integration: None,
        comments: Some(
            "This is test task 1",
        ),
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "SELECT * FROM MyTable1",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 1215 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 3 COMMENT = 'This is test task 1' AS SELECT * FROM MyTable1
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 1215 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 3 COMMENTS = 'This is test task 1' AS SELECT * FROM MyTable1
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: Some(
            "MyWarehouse",
        ),
        schedule_opts: Some(
            IntervalSecs(
                1215,
                0,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: Some(
            3,
        ),
        error_integration: None,
        comments: Some(
            "This is test task 1",
        ),
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "SELECT * FROM MyTable1",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 COMMENT = '123' SCHEDULE = 1215 SECOND WAREHOUSE = 'MyWarehouse' SUSPEND_TASK_AFTER_NUM_FAILURES = 3 AS SELECT * FROM MyTable1
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 WAREHOUSE = 'MyWarehouse' SCHEDULE = 1215 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 3 COMMENTS = '123' AS SELECT * FROM MyTable1
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: Some(
            "MyWarehouse",
        ),
        schedule_opts: Some(
            IntervalSecs(
                1215,
                0,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: Some(
            3,
        ),
        error_integration: None,
        comments: Some(
            "123",
        ),
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "SELECT * FROM MyTable1",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 SCHEDULE = USING CRON '0 6 * * *' 'America/Los_Angeles' COMMENT = 'serverless + cron' AS insert into t (c1, c2) values (1, 2), (3, 4)
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 SCHEDULE = USING CRON '0 6 * * *' 'America/Los_Angeles' COMMENTS = 'serverless + cron' AS INSERT INTO t (c1, c2) VALUES (1, 2), (3, 4)
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: None,
        schedule_opts: Some(
            CronExpression(
                "0 6 * * *",
                Some(
                    "America/Los_Angeles",
                ),
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: Some(
            "serverless + cron",
        ),
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "INSERT INTO t (c1, c2) VALUES (1, 2), (3, 4)",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 SCHEDULE = USING CRON '0 12 * * *' AS copy into streams_test.paper_table from @stream_stage FILE_FORMAT = (TYPE = PARQUET) PURGE=true
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 SCHEDULE = USING CRON '0 12 * * *' AS COPY INTO streams_test.paper_table FROM '@stream_stage' FILE_FORMAT = (type = PARQUET)  PURGE = true FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: None,
        schedule_opts: Some(
            CronExpression(
                "0 12 * * *",
                None,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "COPY INTO streams_test.paper_table FROM '@stream_stage' FILE_FORMAT = (type = PARQUET)  PURGE = true FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 SCHEDULE = USING CRON '0 13 * * *' AS COPY INTO @my_internal_stage FROM canadian_city_population FILE_FORMAT = (TYPE = PARQUET)
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 SCHEDULE = USING CRON '0 13 * * *' AS COPY INTO '@my_internal_stage' FROM canadian_city_population FILE_FORMAT = (type = PARQUET) SINGLE = false MAX_FILE_SIZE = 0 DETAILED_OUTPUT = false INCLUDE_QUERY_ID = true USE_RAW_PATH = false OVERWRITE = false
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: None,
        schedule_opts: Some(
            CronExpression(
                "0 13 * * *",
                None,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "COPY INTO '@my_internal_stage' FROM canadian_city_population FILE_FORMAT = (type = PARQUET) SINGLE = false MAX_FILE_SIZE = 0 DETAILED_OUTPUT = false INCLUDE_QUERY_ID = true USE_RAW_PATH = false OVERWRITE = false",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 AFTER 'task2', 'task3' WHEN SYSTEM$GET_PREDECESSOR_RETURN_VALUE('task_name') != 'VALIDATION' AS VACUUM TABLE t
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 AFTER 'task2', 'task3' WHEN SYSTEM$GET_PREDECESSOR_RETURN_VALUE('task_name') <> 'VALIDATION' AS VACUUM TABLE t 
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: None,
        schedule_opts: None,
        session_parameters: {},
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [
            "task2",
            "task3",
        ],
        when_condition: Some(
            BinaryOp {
                span: Some(
                    111..113,
                ),
                op: NotEq,
                left: FunctionCall {
                    span: Some(
                        62..110,
                    ),
                    func: FunctionCall {
                        distinct: false,
                        name: Identifier {
                            span: Some(
                                62..97,
                            ),
                            name: "SYSTEM$GET_PREDECESSOR_RETURN_VALUE",
                            quote: None,
                            ident_type: None,
                        },
                        args: [
                            Literal {
                                span: Some(
                                    98..109,
                                ),
                                value: String(
                                    "task_name",
                                ),
                            },
                        ],
                        params: [],
                        order_by: [],
                        window: None,
                        lambda: None,
                    },
                },
                right: Literal {
                    span: Some(
                        114..126,
                    ),
                    value: String(
                        "VALIDATION",
                    ),
                },
            },
        ),
        sql: SingleStatement(
            "VACUUM TABLE t ",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 DATABASE = 'target', TIMEZONE = 'America/Los Angeles'  AS VACUUM TABLE t
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 database = 'target', timezone = 'America/Los Angeles' AS VACUUM TABLE t 
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: None,
        schedule_opts: None,
        session_parameters: {
            "database": "target",
            "timezone": "America/Los Angeles",
        },
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [],
        when_condition: None,
        sql: SingleStatement(
            "VACUUM TABLE t ",
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS MyTask1 DATABASE = 'target', TIMEZONE = 'America/Los Angeles' as
    BEGIN
    begin;
    insert into t values('a;');
    delete from t where c = ';';
    vacuum table t;
    merge into t using s on t.id = s.id when matched then update *;
    commit;
    END
---------- Output ---------
CREATE TASK IF NOT EXISTS MyTask1 database = 'target', timezone = 'America/Los Angeles' AS BEGIN
BEGIN;
INSERT INTO t VALUES ('a;');
DELETE FROM t WHERE c = ';';
VACUUM TABLE t ;
MERGE INTO t USING s ON t.id = s.id WHEN MATCHED THEN UPDATE *;
COMMIT;
END;
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "MyTask1",
        warehouse: None,
        schedule_opts: None,
        session_parameters: {
            "database": "target",
            "timezone": "America/Los Angeles",
        },
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [],
        when_condition: None,
        sql: ScriptBlock(
            [
                "BEGIN",
                "INSERT INTO t VALUES ('a;')",
                "DELETE FROM t WHERE c = ';'",
                "VACUUM TABLE t ",
                "MERGE INTO t USING s ON t.id = s.id WHEN MATCHED THEN UPDATE *",
                "COMMIT",
            ],
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS merge_task WAREHOUSE = 'test-parser' SCHEDULE = 1 SECOND
AS BEGIN
MERGE INTO t USING s ON t.c = s.c
    WHEN MATCHED THEN
    UPDATE
        *
        WHEN NOT MATCHED THEN
    INSERT
        *;
END
---------- Output ---------
CREATE TASK IF NOT EXISTS merge_task WAREHOUSE = 'test-parser' SCHEDULE = 1 SECOND AS BEGIN
MERGE INTO t USING s ON t.c = s.c WHEN MATCHED THEN UPDATE * WHEN NOT MATCHED THEN INSERT *;
END;
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "merge_task",
        warehouse: Some(
            "test-parser",
        ),
        schedule_opts: Some(
            IntervalSecs(
                1,
                0,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [],
        when_condition: None,
        sql: ScriptBlock(
            [
                "MERGE INTO t USING s ON t.c = s.c WHEN MATCHED THEN UPDATE * WHEN NOT MATCHED THEN INSERT *",
            ],
        ),
    },
)


---------- Input ----------
CREATE TASK IF NOT EXISTS merge_task WAREHOUSE = 'test-parser' SCHEDULE = 1 SECOND
AS BEGIN
MERGE INTO t USING s ON t.c = s.c
    WHEN MATCHED THEN
    UPDATE
        *
        WHEN NOT MATCHED THEN
    INSERT values('a;', 1, "str");
END
---------- Output ---------
CREATE TASK IF NOT EXISTS merge_task WAREHOUSE = 'test-parser' SCHEDULE = 1 SECOND AS BEGIN
MERGE INTO t USING s ON t.c = s.c WHEN MATCHED THEN UPDATE * WHEN NOT MATCHED THEN INSERT VALUES('a;', 1, "str");
END;
---------- AST ------------
CreateTask(
    CreateTaskStmt {
        create_option: CreateIfNotExists,
        name: "merge_task",
        warehouse: Some(
            "test-parser",
        ),
        schedule_opts: Some(
            IntervalSecs(
                1,
                0,
            ),
        ),
        session_parameters: {},
        suspend_task_after_num_failures: None,
        error_integration: None,
        comments: None,
        after: [],
        when_condition: None,
        sql: ScriptBlock(
            [
                "MERGE INTO t USING s ON t.c = s.c WHEN MATCHED THEN UPDATE * WHEN NOT MATCHED THEN INSERT VALUES('a;', 1, \"str\")",
            ],
        ),
    },
)


---------- Input ----------
ALTER TASK MyTask1 RESUME
---------- Output ---------
ALTER TASK MyTask1 RESUME
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Resume,
    },
)


---------- Input ----------
ALTER TASK MyTask1 SUSPEND
---------- Output ---------
ALTER TASK MyTask1 SUSPEND
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Suspend,
    },
)


---------- Input ----------
ALTER TASK MyTask1 ADD AFTER 'task2', 'task3'
---------- Output ---------
ALTER TASK MyTask1 ADD AFTER 'task2', 'task3'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: AddAfter(
            [
                "task2",
                "task3",
            ],
        ),
    },
)


---------- Input ----------
ALTER TASK MyTask1 REMOVE AFTER 'task2'
---------- Output ---------
ALTER TASK MyTask1 REMOVE AFTER 'task2'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: RemoveAfter(
            [
                "task2",
            ],
        ),
    },
)


---------- Input ----------
ALTER TASK MyTask1 SET WAREHOUSE= 'MyWarehouse' SCHEDULE = USING CRON '0 6 * * *' 'America/Los_Angeles' COMMENT = 'serverless + cron'
---------- Output ---------
ALTER TASK MyTask1 SET WAREHOUSE = 'MyWarehouse' SCHEDULE = USING CRON '0 6 * * *' 'America/Los_Angeles' COMMENT = 'serverless + cron'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Set {
            warehouse: Some(
                "MyWarehouse",
            ),
            schedule: Some(
                CronExpression(
                    "0 6 * * *",
                    Some(
                        "America/Los_Angeles",
                    ),
                ),
            ),
            suspend_task_after_num_failures: None,
            comments: Some(
                "serverless + cron",
            ),
            session_parameters: None,
            error_integration: None,
        },
    },
)


---------- Input ----------
ALTER TASK MyTask1 SET WAREHOUSE= 'MyWarehouse' SCHEDULE = 13 MINUTE SUSPEND_TASK_AFTER_NUM_FAILURES = 10 COMMENT = 'serverless + cron'
---------- Output ---------
ALTER TASK MyTask1 SET WAREHOUSE = 'MyWarehouse' SCHEDULE = 780 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 10 COMMENT = 'serverless + cron'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Set {
            warehouse: Some(
                "MyWarehouse",
            ),
            schedule: Some(
                IntervalSecs(
                    780,
                    0,
                ),
            ),
            suspend_task_after_num_failures: Some(
                10,
            ),
            comments: Some(
                "serverless + cron",
            ),
            session_parameters: None,
            error_integration: None,
        },
    },
)


---------- Input ----------
ALTER TASK MyTask1 SET SCHEDULE = 5 SECOND WAREHOUSE='MyWarehouse' SUSPEND_TASK_AFTER_NUM_FAILURES = 10 COMMENT = 'serverless + cron'
---------- Output ---------
ALTER TASK MyTask1 SET WAREHOUSE = 'MyWarehouse' SCHEDULE = 5 SECOND SUSPEND_TASK_AFTER_NUM_FAILURES = 10 COMMENT = 'serverless + cron'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Set {
            warehouse: Some(
                "MyWarehouse",
            ),
            schedule: Some(
                IntervalSecs(
                    5,
                    0,
                ),
            ),
            suspend_task_after_num_failures: Some(
                10,
            ),
            comments: Some(
                "serverless + cron",
            ),
            session_parameters: None,
            error_integration: None,
        },
    },
)


---------- Input ----------
ALTER TASK MyTask1 SET DATABASE='newDB', TIMEZONE='America/Los_Angeles'
---------- Output ---------
ALTER TASK MyTask1 SET database = 'newDB', timezone = 'America/Los_Angeles'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Set {
            warehouse: None,
            schedule: None,
            suspend_task_after_num_failures: None,
            comments: None,
            session_parameters: Some(
                {
                    "database": "newDB",
                    "timezone": "America/Los_Angeles",
                },
            ),
            error_integration: None,
        },
    },
)


---------- Input ----------
ALTER TASK MyTask1 SET ERROR_INTEGRATION = 'candidate_notifictaion'
---------- Output ---------
ALTER TASK MyTask1 SET ERROR_INTEGRATION = 'candidate_notifictaion'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: Set {
            warehouse: None,
            schedule: None,
            suspend_task_after_num_failures: None,
            comments: None,
            session_parameters: None,
            error_integration: Some(
                "candidate_notifictaion",
            ),
        },
    },
)


---------- Input ----------
ALTER TASK MyTask2 MODIFY AS SELECT CURRENT_VERSION()
---------- Output ---------
ALTER TASK MyTask2 MODIFY AS SELECT CURRENT_VERSION()
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask2",
        options: ModifyAs(
            SingleStatement(
                "SELECT CURRENT_VERSION()",
            ),
        ),
    },
)


---------- Input ----------
ALTER TASK MyTask2 MODIFY AS
BEGIN
  begin;
  insert into t values('a;');
  delete from t where c = ';';
  vacuum table t;
  merge into t using s on t.id = s.id when matched then update *;
  commit;
END
---------- Output ---------
ALTER TASK MyTask2 MODIFY AS BEGIN
BEGIN;
INSERT INTO t VALUES ('a;');
DELETE FROM t WHERE c = ';';
VACUUM TABLE t ;
MERGE INTO t USING s ON t.id = s.id WHEN MATCHED THEN UPDATE *;
COMMIT;
END;
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask2",
        options: ModifyAs(
            ScriptBlock(
                [
                    "BEGIN",
                    "INSERT INTO t VALUES ('a;')",
                    "DELETE FROM t WHERE c = ';'",
                    "VACUUM TABLE t ",
                    "MERGE INTO t USING s ON t.id = s.id WHEN MATCHED THEN UPDATE *",
                    "COMMIT",
                ],
            ),
        ),
    },
)


---------- Input ----------
ALTER TASK MyTask1 MODIFY WHEN SYSTEM$GET_PREDECESSOR_RETURN_VALUE('task_name') != 'VALIDATION'
---------- Output ---------
ALTER TASK MyTask1 MODIFY WHEN SYSTEM$GET_PREDECESSOR_RETURN_VALUE('task_name') <> 'VALIDATION'
---------- AST ------------
AlterTask(
    AlterTaskStmt {
        if_exists: false,
        name: "MyTask1",
        options: ModifyWhen(
            BinaryOp {
                span: Some(
                    80..82,
                ),
                op: NotEq,
                left: FunctionCall {
                    span: Some(
                        31..79,
                    ),
                    func: FunctionCall {
                        distinct: false,
                        name: Identifier {
                            span: Some(
                                31..66,
                            ),
                            name: "SYSTEM$GET_PREDECESSOR_RETURN_VALUE",
                            quote: None,
                            ident_type: None,
                        },
                        args: [
                            Literal {
                                span: Some(
                                    67..78,
                                ),
                                value: String(
                                    "task_name",
                                ),
                            },
                        ],
                        params: [],
                        order_by: [],
                        window: None,
                        lambda: None,
                    },
                },
                right: Literal {
                    span: Some(
                        83..95,
                    ),
                    value: String(
                        "VALIDATION",
                    ),
                },
            },
        ),
    },
)


---------- Input ----------
DROP TASK MyTask1
---------- Output ---------
DROP TASK MyTask1
---------- AST ------------
DropTask(
    DropTaskStmt {
        if_exists: false,
        name: "MyTask1",
    },
)


---------- Input ----------
SHOW TASKS
---------- Output ---------
SHOW TASKS
---------- AST ------------
ShowTasks(
    ShowTasksStmt {
        limit: None,
    },
)


---------- Input ----------
EXECUTE TASK MyTask
---------- Output ---------
EXECUTE TASK MyTask
---------- AST ------------
ExecuteTask(
    ExecuteTaskStmt {
        name: Identifier {
            span: Some(
                13..19,
            ),
            name: "MyTask",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
DESC TASK MyTask
---------- Output ---------
DESCRIBE TASK MyTask
---------- AST ------------
DescribeTask(
    DescribeTaskStmt {
        name: Identifier {
            span: Some(
                10..16,
            ),
            name: "MyTask",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
CREATE CONNECTION IF NOT EXISTS my_conn STORAGE_TYPE='s3'
---------- Output ---------
CREATE CONNECTION IF NOT EXISTS my_conn STORAGE_TYPE = 's3'
---------- AST ------------
CreateConnection(
    CreateConnectionStmt {
        name: Identifier {
            span: Some(
                32..39,
            ),
            name: "my_conn",
            quote: None,
            ident_type: None,
        },
        storage_type: "s3",
        storage_params: {},
        create_option: CreateIfNotExists,
    },
)


---------- Input ----------
CREATE CONNECTION IF NOT EXISTS my_conn STORAGE_TYPE='s3' any_arg='any_value'
---------- Output ---------
CREATE CONNECTION IF NOT EXISTS my_conn STORAGE_TYPE = 's3' any_arg = 'any_value'
---------- AST ------------
CreateConnection(
    CreateConnectionStmt {
        name: Identifier {
            span: Some(
                32..39,
            ),
            name: "my_conn",
            quote: None,
            ident_type: None,
        },
        storage_type: "s3",
        storage_params: {
            "any_arg": "any_value",
        },
        create_option: CreateIfNotExists,
    },
)


---------- Input ----------
CREATE OR REPLACE CONNECTION my_conn STORAGE_TYPE='s3' any_arg='any_value'
---------- Output ---------
CREATE OR REPLACE CONNECTION my_conn STORAGE_TYPE = 's3' any_arg = 'any_value'
---------- AST ------------
CreateConnection(
    CreateConnectionStmt {
        name: Identifier {
            span: Some(
                29..36,
            ),
            name: "my_conn",
            quote: None,
            ident_type: None,
        },
        storage_type: "s3",
        storage_params: {
            "any_arg": "any_value",
        },
        create_option: CreateOrReplace,
    },
)


---------- Input ----------
DROP CONNECTION IF EXISTS my_conn;
---------- Output ---------
DROP CONNECTION IF EXISTS my_conn 
---------- AST ------------
DropConnection(
    DropConnectionStmt {
        if_exists: true,
        name: Identifier {
            span: Some(
                26..33,
            ),
            name: "my_conn",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
DESC CONNECTION my_conn;
---------- Output ---------
DESCRIBE CONNECTION my_conn 
---------- AST ------------
DescribeConnection(
    DescribeConnectionStmt {
        name: Identifier {
            span: Some(
                16..23,
            ),
            name: "my_conn",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
SHOW CONNECTIONS;
---------- Output ---------
SHOW CONNECTIONS
---------- AST ------------
ShowConnections(
    ShowConnectionsStmt,
)


---------- Input ----------
SHOW LOCKS IN ACCOUNT
---------- Output ---------
SHOW LOCKS IN ACCOUNT
---------- AST ------------
ShowLocks(
    ShowLocksStmt {
        in_account: true,
        limit: None,
    },
)


---------- Input ----------
CREATE PIPE IF NOT EXISTS MyPipe1 AUTO_INGEST = TRUE COMMENT = 'This is test pipe 1' AS COPY INTO MyTable1 FROM '@~/MyStage1' FILE_FORMAT = (TYPE = 'CSV')
---------- Output ---------
CREATE PIPE IF NOT EXISTS MyPipe1 AUTO_INGEST = TRUE COMMENTS = 'This is test pipe 1' AS COPY INTO MyTable1 FROM '@~/MyStage1' FILE_FORMAT = (type = 'CSV')  PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CreatePipe(
    CreatePipeStmt {
        if_not_exists: true,
        name: "MyPipe1",
        auto_ingest: true,
        comments: "This is test pipe 1",
        copy_stmt: CopyIntoTableStmt {
            with: None,
            src: Location(
                Stage(
                    "~/MyStage1",
                ),
            ),
            dst: TableRef {
                catalog: None,
                database: None,
                table: Identifier {
                    span: Some(
                        98..106,
                    ),
                    name: "MyTable1",
                    quote: None,
                    ident_type: None,
                },
                with_options: None,
            },
            dst_columns: None,
            hints: None,
            file_format: FileFormatOptions {
                options: {
                    "type": String(
                        "CSV",
                    ),
                },
            },
            files: None,
            pattern: None,
            options: CopyIntoTableOptions {
                on_error: AbortNum(
                    1,
                ),
                size_limit: 0,
                max_files: 0,
                split_size: 0,
                force: false,
                purge: false,
                disable_variant_check: false,
                return_failed_only: false,
                validation_mode: "",
                column_match_mode: None,
            },
        },
    },
)


---------- Input ----------
CREATE PIPE pipe1 AS COPY INTO db1.MyTable1 FROM @~/mybucket/data.csv
---------- Output ---------
CREATE PIPE pipe1 AS COPY INTO db1.MyTable1 FROM '@~/mybucket/data.csv'  PURGE = false FORCE = false DISABLE_VARIANT_CHECK = false ON_ERROR = abort RETURN_FAILED_ONLY = false
---------- AST ------------
CreatePipe(
    CreatePipeStmt {
        if_not_exists: false,
        name: "pipe1",
        auto_ingest: false,
        comments: "",
        copy_stmt: CopyIntoTableStmt {
            with: None,
            src: Location(
                Stage(
                    "~/mybucket/data.csv",
                ),
            ),
            dst: TableRef {
                catalog: None,
                database: Some(
                    Identifier {
                        span: Some(
                            31..34,
                        ),
                        name: "db1",
                        quote: None,
                        ident_type: None,
                    },
                ),
                table: Identifier {
                    span: Some(
                        35..43,
                    ),
                    name: "MyTable1",
                    quote: None,
                    ident_type: None,
                },
                with_options: None,
            },
            dst_columns: None,
            hints: None,
            file_format: FileFormatOptions {
                options: {},
            },
            files: None,
            pattern: None,
            options: CopyIntoTableOptions {
                on_error: AbortNum(
                    1,
                ),
                size_limit: 0,
                max_files: 0,
                split_size: 0,
                force: false,
                purge: false,
                disable_variant_check: false,
                return_failed_only: false,
                validation_mode: "",
                column_match_mode: None,
            },
        },
    },
)


---------- Input ----------
ALTER PIPE mypipe REFRESH
---------- Output ---------
ALTER PIPE mypipe REFRESH
---------- AST ------------
AlterPipe(
    AlterPipeStmt {
        if_exists: false,
        name: "mypipe",
        options: Refresh {
            prefix: None,
            modified_after: None,
        },
    },
)


---------- Input ----------
ALTER PIPE mypipe REFRESH PREFIX='d1/'
---------- Output ---------
ALTER PIPE mypipe REFRESH PREFIX = 'd1/'
---------- AST ------------
AlterPipe(
    AlterPipeStmt {
        if_exists: false,
        name: "mypipe",
        options: Refresh {
            prefix: Some(
                "d1/",
            ),
            modified_after: None,
        },
    },
)


---------- Input ----------
ALTER PIPE mypipe REFRESH PREFIX='d1/' MODIFIED_AFTER='2018-07-30T13:56:46-07:00'
---------- Output ---------
ALTER PIPE mypipe REFRESH PREFIX = 'd1/' MODIFIED_AFTER = '2018-07-30T13:56:46-07:00'
---------- AST ------------
AlterPipe(
    AlterPipeStmt {
        if_exists: false,
        name: "mypipe",
        options: Refresh {
            prefix: Some(
                "d1/",
            ),
            modified_after: Some(
                "2018-07-30T13:56:46-07:00",
            ),
        },
    },
)


---------- Input ----------
ALTER PIPE mypipe SET PIPE_EXECUTION_PAUSED = true
---------- Output ---------
ALTER PIPE mypipe SET PIPE_EXECUTION_PAUSED = true
---------- AST ------------
AlterPipe(
    AlterPipeStmt {
        if_exists: false,
        name: "mypipe",
        options: Set {
            execution_paused: Some(
                true,
            ),
            comments: None,
        },
    },
)


---------- Input ----------
DROP PIPE mypipe
---------- Output ---------
DROP PIPE mypipe
---------- AST ------------
DropPipe(
    DropPipeStmt {
        if_exists: false,
        name: "mypipe",
    },
)


---------- Input ----------
DESC PIPE mypipe
---------- Output ---------
DESCRIBE PIPE mypipe
---------- AST ------------
DescribePipe(
    DescribePipeStmt {
        name: "mypipe",
    },
)


---------- Input ----------
CREATE NOTIFICATION INTEGRATION IF NOT EXISTS SampleNotification type = webhook enabled = true webhook = (url = 'https://example.com', method = 'GET', authorization_header = 'bearer auth')
---------- Output ---------
CREATE NOTIFICATION INTEGRATION IF NOT EXISTS SampleNotification TYPE = webhook ENABLED = true WEBHOOK = ( URL = 'https://example.com' METHOD = 'GET' AUTHORIZATION_HEADER = 'bearer auth' )
---------- AST ------------
CreateNotification(
    CreateNotificationStmt {
        if_not_exists: true,
        name: "SampleNotification",
        notification_type: "webhook",
        enabled: true,
        webhook_opts: Some(
            NotificationWebhookOptions {
                url: Some(
                    "https://example.com",
                ),
                method: Some(
                    "GET",
                ),
                authorization_header: Some(
                    "bearer auth",
                ),
            },
        ),
        comments: None,
    },
)


---------- Input ----------
CREATE NOTIFICATION INTEGRATION SampleNotification type = webhook enabled = true webhook = (url = 'https://example.com') COMMENT = 'notify'
---------- Output ---------
CREATE NOTIFICATION INTEGRATION SampleNotification TYPE = webhook ENABLED = true WEBHOOK = ( URL = 'https://example.com' ) COMMENTS = 'notify'
---------- AST ------------
CreateNotification(
    CreateNotificationStmt {
        if_not_exists: false,
        name: "SampleNotification",
        notification_type: "webhook",
        enabled: true,
        webhook_opts: Some(
            NotificationWebhookOptions {
                url: Some(
                    "https://example.com",
                ),
                method: None,
                authorization_header: None,
            },
        ),
        comments: Some(
            "notify",
        ),
    },
)


---------- Input ----------
ALTER NOTIFICATION INTEGRATION SampleNotification SET enabled = true
---------- Output ---------
ALTER NOTIFICATION INTEGRATION SampleNotification SET ENABLED = true
---------- AST ------------
AlterNotification(
    AlterNotificationStmt {
        if_exists: false,
        name: "SampleNotification",
        options: Set(
            AlterNotificationSetOptions {
                enabled: Some(
                    true,
                ),
                webhook_opts: None,
                comments: None,
            },
        ),
    },
)


---------- Input ----------
ALTER NOTIFICATION INTEGRATION SampleNotification SET webhook = (url = 'https://example.com')
---------- Output ---------
ALTER NOTIFICATION INTEGRATION SampleNotification SET  WEBHOOK = ( URL = 'https://example.com' )
---------- AST ------------
AlterNotification(
    AlterNotificationStmt {
        if_exists: false,
        name: "SampleNotification",
        options: Set(
            AlterNotificationSetOptions {
                enabled: None,
                webhook_opts: Some(
                    NotificationWebhookOptions {
                        url: Some(
                            "https://example.com",
                        ),
                        method: None,
                        authorization_header: None,
                    },
                ),
                comments: None,
            },
        ),
    },
)


---------- Input ----------
ALTER NOTIFICATION INTEGRATION SampleNotification SET comment = '1'
---------- Output ---------
ALTER NOTIFICATION INTEGRATION SampleNotification SET  COMMENTS = '1'
---------- AST ------------
AlterNotification(
    AlterNotificationStmt {
        if_exists: false,
        name: "SampleNotification",
        options: Set(
            AlterNotificationSetOptions {
                enabled: None,
                webhook_opts: None,
                comments: Some(
                    "1",
                ),
            },
        ),
    },
)


---------- Input ----------
DROP NOTIFICATION INTEGRATION SampleNotification
---------- Output ---------
DROP NOTIFICATION INTEGRATION SampleNotification
---------- AST ------------
DropNotification(
    DropNotificationStmt {
        if_exists: false,
        name: "SampleNotification",
    },
)


---------- Input ----------
DESC NOTIFICATION INTEGRATION SampleNotification
---------- Output ---------
DESCRIBE NOTIFICATION INTEGRATION SampleNotification
---------- AST ------------
DescribeNotification(
    DescribeNotificationStmt {
        name: "SampleNotification",
    },
)


---------- Input ----------
--各环节转各环节转各环节转各环节转各
select 34343
---------- Output ---------
SELECT 34343
---------- AST ------------
Query(
    Query {
        span: Some(
            54..66,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    54..66,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                61..66,
                            ),
                            value: UInt64(
                                34343,
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
-- 96477300355	31379974136	3.074486292973661
select 34343
---------- Output ---------
SELECT 34343
---------- AST ------------
Query(
    Query {
        span: Some(
            45..57,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    45..57,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                52..57,
                            ),
                            value: UInt64(
                                34343,
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
-- xxxxx
select 34343;
---------- Output ---------
SELECT 34343
---------- AST ------------
Query(
    Query {
        span: Some(
            9..21,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    9..21,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: Literal {
                            span: Some(
                                16..21,
                            ),
                            value: UInt64(
                                34343,
                            ),
                        },
                        alias: None,
                    },
                ],
                from: [],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
REMOVE @t;
---------- Output ---------
REMOVE @t
---------- AST ------------
RemoveStage {
    location: "t",
    pattern: "",
}


---------- Input ----------
SELECT sum(d) OVER (w) FROM e;
---------- Output ---------
SELECT sum(d) OVER (w) FROM e
---------- AST ------------
Query(
    Query {
        span: Some(
            0..29,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..29,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..22,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..10,
                                    ),
                                    name: "sum",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            11..12,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        11..12,
                                                    ),
                                                    name: "d",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: None,
                                        window: WindowSpec(
                                            WindowSpec {
                                                existing_window_name: Some(
                                                    Identifier {
                                                        span: Some(
                                                            20..21,
                                                        ),
                                                        name: "w",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                partition_by: [],
                                                order_by: [],
                                                window_frame: None,
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            28..29,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                28..29,
                            ),
                            name: "e",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT first_value(d) OVER (w) FROM e;
---------- Output ---------
SELECT first_value(d) OVER (w) FROM e
---------- AST ------------
Query(
    Query {
        span: Some(
            0..37,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..37,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..30,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..18,
                                    ),
                                    name: "first_value",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            19..20,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        19..20,
                                                    ),
                                                    name: "d",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: None,
                                        window: WindowSpec(
                                            WindowSpec {
                                                existing_window_name: Some(
                                                    Identifier {
                                                        span: Some(
                                                            28..29,
                                                        ),
                                                        name: "w",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                partition_by: [],
                                                order_by: [],
                                                window_frame: None,
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            36..37,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                36..37,
                            ),
                            name: "e",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT first_value(d) ignore nulls OVER (w) FROM e;
---------- Output ---------
SELECT first_value(d) IGNORE NULLS OVER (w) FROM e
---------- AST ------------
Query(
    Query {
        span: Some(
            0..50,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..50,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..43,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..18,
                                    ),
                                    name: "first_value",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            19..20,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        19..20,
                                                    ),
                                                    name: "d",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: Some(
                                            true,
                                        ),
                                        window: WindowSpec(
                                            WindowSpec {
                                                existing_window_name: Some(
                                                    Identifier {
                                                        span: Some(
                                                            41..42,
                                                        ),
                                                        name: "w",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                partition_by: [],
                                                order_by: [],
                                                window_frame: None,
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            49..50,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                49..50,
                            ),
                            name: "e",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT first_value(d) respect nulls OVER (w) FROM e;
---------- Output ---------
SELECT first_value(d) RESPECT NULLS OVER (w) FROM e
---------- AST ------------
Query(
    Query {
        span: Some(
            0..51,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..51,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..44,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..18,
                                    ),
                                    name: "first_value",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            19..20,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        19..20,
                                                    ),
                                                    name: "d",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: Some(
                                            false,
                                        ),
                                        window: WindowSpec(
                                            WindowSpec {
                                                existing_window_name: Some(
                                                    Identifier {
                                                        span: Some(
                                                            42..43,
                                                        ),
                                                        name: "w",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                partition_by: [],
                                                order_by: [],
                                                window_frame: None,
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            50..51,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                50..51,
                            ),
                            name: "e",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT sum(d) IGNORE NULLS OVER (w) FROM e;
---------- Output ---------
SELECT sum(d) IGNORE NULLS OVER (w) FROM e
---------- AST ------------
Query(
    Query {
        span: Some(
            0..42,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..42,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..35,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..10,
                                    ),
                                    name: "sum",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            11..12,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        11..12,
                                                    ),
                                                    name: "d",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: Some(
                                            true,
                                        ),
                                        window: WindowSpec(
                                            WindowSpec {
                                                existing_window_name: Some(
                                                    Identifier {
                                                        span: Some(
                                                            33..34,
                                                        ),
                                                        name: "w",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                                partition_by: [],
                                                order_by: [],
                                                window_frame: None,
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            41..42,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                41..42,
                            ),
                            name: "e",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT sum(d) OVER w FROM e WINDOW w AS (PARTITION BY f ORDER BY g);
---------- Output ---------
SELECT sum(d) OVER w FROM e WINDOW w AS (PARTITION BY f ORDER BY g)
---------- AST ------------
Query(
    Query {
        span: Some(
            0..67,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..67,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                7..20,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        7..10,
                                    ),
                                    name: "sum",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [
                                    ColumnRef {
                                        span: Some(
                                            11..12,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        11..12,
                                                    ),
                                                    name: "d",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: None,
                                        window: WindowReference(
                                            WindowRef {
                                                window_name: Identifier {
                                                    span: Some(
                                                        19..20,
                                                    ),
                                                    name: "w",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            26..27,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                26..27,
                            ),
                            name: "e",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: Some(
                    [
                        WindowDefinition {
                            name: Identifier {
                                span: Some(
                                    35..36,
                                ),
                                name: "w",
                                quote: None,
                                ident_type: None,
                            },
                            spec: WindowSpec {
                                existing_window_name: None,
                                partition_by: [
                                    ColumnRef {
                                        span: Some(
                                            54..55,
                                        ),
                                        column: ColumnRef {
                                            database: None,
                                            table: None,
                                            column: Name(
                                                Identifier {
                                                    span: Some(
                                                        54..55,
                                                    ),
                                                    name: "f",
                                                    quote: None,
                                                    ident_type: None,
                                                },
                                            ),
                                        },
                                    },
                                ],
                                order_by: [
                                    OrderByExpr {
                                        expr: ColumnRef {
                                            span: Some(
                                                65..66,
                                            ),
                                            column: ColumnRef {
                                                database: None,
                                                table: None,
                                                column: Name(
                                                    Identifier {
                                                        span: Some(
                                                            65..66,
                                                        ),
                                                        name: "g",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                ),
                                            },
                                        },
                                        asc: None,
                                        nulls_first: None,
                                    },
                                ],
                                window_frame: None,
                            },
                        },
                    ],
                ),
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
SELECT number, rank() OVER (PARTITION BY number % 3 ORDER BY number)
FROM numbers(10) where number > 10 and number > 9 and number > 8;
---------- Output ---------
SELECT number, rank() OVER (PARTITION BY number % 3 ORDER BY number) FROM numbers(10) WHERE number > 10 AND number > 9 AND number > 8
---------- AST ------------
Query(
    Query {
        span: Some(
            0..133,
        ),
        with: None,
        body: Select(
            SelectStmt {
                span: Some(
                    0..133,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    AliasedExpr {
                        expr: ColumnRef {
                            span: Some(
                                7..13,
                            ),
                            column: ColumnRef {
                                database: None,
                                table: None,
                                column: Name(
                                    Identifier {
                                        span: Some(
                                            7..13,
                                        ),
                                        name: "number",
                                        quote: None,
                                        ident_type: None,
                                    },
                                ),
                            },
                        },
                        alias: None,
                    },
                    AliasedExpr {
                        expr: FunctionCall {
                            span: Some(
                                15..68,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        15..19,
                                    ),
                                    name: "rank",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [],
                                params: [],
                                order_by: [],
                                window: Some(
                                    WindowDesc {
                                        ignore_nulls: None,
                                        window: WindowSpec(
                                            WindowSpec {
                                                existing_window_name: None,
                                                partition_by: [
                                                    BinaryOp {
                                                        span: Some(
                                                            48..49,
                                                        ),
                                                        op: Modulo,
                                                        left: ColumnRef {
                                                            span: Some(
                                                                41..47,
                                                            ),
                                                            column: ColumnRef {
                                                                database: None,
                                                                table: None,
                                                                column: Name(
                                                                    Identifier {
                                                                        span: Some(
                                                                            41..47,
                                                                        ),
                                                                        name: "number",
                                                                        quote: None,
                                                                        ident_type: None,
                                                                    },
                                                                ),
                                                            },
                                                        },
                                                        right: Literal {
                                                            span: Some(
                                                                50..51,
                                                            ),
                                                            value: UInt64(
                                                                3,
                                                            ),
                                                        },
                                                    },
                                                ],
                                                order_by: [
                                                    OrderByExpr {
                                                        expr: ColumnRef {
                                                            span: Some(
                                                                61..67,
                                                            ),
                                                            column: ColumnRef {
                                                                database: None,
                                                                table: None,
                                                                column: Name(
                                                                    Identifier {
                                                                        span: Some(
                                                                            61..67,
                                                                        ),
                                                                        name: "number",
                                                                        quote: None,
                                                                        ident_type: None,
                                                                    },
                                                                ),
                                                            },
                                                        },
                                                        asc: None,
                                                        nulls_first: None,
                                                    },
                                                ],
                                                window_frame: None,
                                            },
                                        ),
                                    },
                                ),
                                lambda: None,
                            },
                        },
                        alias: None,
                    },
                ],
                from: [
                    TableFunction {
                        span: Some(
                            74..85,
                        ),
                        lateral: false,
                        name: Identifier {
                            span: Some(
                                74..81,
                            ),
                            name: "numbers",
                            quote: None,
                            ident_type: None,
                        },
                        params: [
                            Literal {
                                span: Some(
                                    82..84,
                                ),
                                value: UInt64(
                                    10,
                                ),
                            },
                        ],
                        named_params: [],
                        alias: None,
                        sample: None,
                    },
                ],
                selection: Some(
                    BinaryOp {
                        span: Some(
                            119..122,
                        ),
                        op: And,
                        left: BinaryOp {
                            span: Some(
                                104..107,
                            ),
                            op: And,
                            left: BinaryOp {
                                span: Some(
                                    99..100,
                                ),
                                op: Gt,
                                left: ColumnRef {
                                    span: Some(
                                        92..98,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    92..98,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        101..103,
                                    ),
                                    value: UInt64(
                                        10,
                                    ),
                                },
                            },
                            right: BinaryOp {
                                span: Some(
                                    115..116,
                                ),
                                op: Gt,
                                left: ColumnRef {
                                    span: Some(
                                        108..114,
                                    ),
                                    column: ColumnRef {
                                        database: None,
                                        table: None,
                                        column: Name(
                                            Identifier {
                                                span: Some(
                                                    108..114,
                                                ),
                                                name: "number",
                                                quote: None,
                                                ident_type: None,
                                            },
                                        ),
                                    },
                                },
                                right: Literal {
                                    span: Some(
                                        117..118,
                                    ),
                                    value: UInt64(
                                        9,
                                    ),
                                },
                            },
                        },
                        right: BinaryOp {
                            span: Some(
                                130..131,
                            ),
                            op: Gt,
                            left: ColumnRef {
                                span: Some(
                                    123..129,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                123..129,
                                            ),
                                            name: "number",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                            right: Literal {
                                span: Some(
                                    132..133,
                                ),
                                value: UInt64(
                                    8,
                                ),
                            },
                        },
                    },
                ),
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
GRANT OWNERSHIP ON d20_0014.* TO ROLE 'd20_0015_owner';
---------- Output ---------
GRANT OWNERSHIP ON  d20_0014.* TO ROLE 'd20_0015_owner'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: Database(
                Some(
                    "d20_0014",
                ),
            ),
        },
        principal: Role(
            "d20_0015_owner",
        ),
    },
)


---------- Input ----------
GRANT OWNERSHIP ON d20_0014.t TO ROLE 'd20_0015_owner';
---------- Output ---------
GRANT OWNERSHIP ON  d20_0014.t TO ROLE 'd20_0015_owner'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: Table(
                Some(
                    "d20_0014",
                ),
                "t",
            ),
        },
        principal: Role(
            "d20_0015_owner",
        ),
    },
)


---------- Input ----------
GRANT OWNERSHIP ON STAGE s1 TO ROLE 'd20_0015_owner';
---------- Output ---------
GRANT OWNERSHIP ON  STAGE s1 TO ROLE 'd20_0015_owner'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: Stage(
                "s1",
            ),
        },
        principal: Role(
            "d20_0015_owner",
        ),
    },
)


---------- Input ----------
GRANT OWNERSHIP ON WAREHOUSE w1 TO ROLE 'd20_0015_owner';
---------- Output ---------
GRANT OWNERSHIP ON  WAREHOUSE w1 TO ROLE 'd20_0015_owner'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: Warehouse(
                "w1",
            ),
        },
        principal: Role(
            "d20_0015_owner",
        ),
    },
)


---------- Input ----------
GRANT OWNERSHIP ON UDF f1 TO ROLE 'd20_0015_owner';
---------- Output ---------
GRANT OWNERSHIP ON  UDF f1 TO ROLE 'd20_0015_owner'
---------- AST ------------
Grant(
    GrantStmt {
        source: Privs {
            privileges: [
                Ownership,
            ],
            level: UDF(
                "f1",
            ),
        },
        principal: Role(
            "d20_0015_owner",
        ),
    },
)


---------- Input ----------
attach table t 's3://a' connection=(access_key_id ='x' secret_access_key ='y' endpoint_url='http://127.0.0.1:9900')
---------- Output ---------
ATTACH TABLE t 's3://a/' CONNECTION = ( access_key_id = 'x', endpoint_url = 'http://127.0.0.1:9900', secret_access_key = 'y' )
---------- AST ------------
AttachTable(
    AttachTableStmt {
        catalog: None,
        database: None,
        table: Identifier {
            span: Some(
                13..14,
            ),
            name: "t",
            quote: None,
            ident_type: None,
        },
        columns_opt: None,
        uri_location: UriLocation {
            protocol: "s3",
            name: "a",
            path: "/",
            connection: Connection {
                visited_keys: {},
                conns: {
                    "access_key_id": "x",
                    "endpoint_url": "http://127.0.0.1:9900",
                    "secret_access_key": "y",
                },
            },
        },
    },
)


---------- Input ----------
CREATE FUNCTION IF NOT EXISTS isnotempty AS(p) -> not(is_null(p));
---------- Output ---------
CREATE FUNCTION IF NOT EXISTS isnotempty AS (p) -> NOT is_null(p)
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateIfNotExists,
        udf_name: Identifier {
            span: Some(
                30..40,
            ),
            name: "isnotempty",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: LambdaUDF {
            parameters: Names(
                [
                    Identifier {
                        span: Some(
                            44..45,
                        ),
                        name: "p",
                        quote: None,
                        ident_type: None,
                    },
                ],
            ),
            definition: UnaryOp {
                span: Some(
                    50..53,
                ),
                op: Not,
                expr: FunctionCall {
                    span: Some(
                        54..64,
                    ),
                    func: FunctionCall {
                        distinct: false,
                        name: Identifier {
                            span: Some(
                                54..61,
                            ),
                            name: "is_null",
                            quote: None,
                            ident_type: None,
                        },
                        args: [
                            ColumnRef {
                                span: Some(
                                    62..63,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                62..63,
                                            ),
                                            name: "p",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                        params: [],
                        order_by: [],
                        window: None,
                        lambda: None,
                    },
                },
            },
        },
    },
)


---------- Input ----------
CREATE FUNCTION IF NOT EXISTS isnotempty AS(p INT) -> not(is_null(p));
---------- Output ---------
CREATE FUNCTION IF NOT EXISTS isnotempty AS (p Int32) -> NOT is_null(p)
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateIfNotExists,
        udf_name: Identifier {
            span: Some(
                30..40,
            ),
            name: "isnotempty",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: LambdaUDF {
            parameters: NameWithTypes(
                [
                    (
                        Identifier {
                            span: Some(
                                44..45,
                            ),
                            name: "p",
                            quote: None,
                            ident_type: None,
                        },
                        Int32,
                    ),
                ],
            ),
            definition: UnaryOp {
                span: Some(
                    54..57,
                ),
                op: Not,
                expr: FunctionCall {
                    span: Some(
                        58..68,
                    ),
                    func: FunctionCall {
                        distinct: false,
                        name: Identifier {
                            span: Some(
                                58..65,
                            ),
                            name: "is_null",
                            quote: None,
                            ident_type: None,
                        },
                        args: [
                            ColumnRef {
                                span: Some(
                                    66..67,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                66..67,
                                            ),
                                            name: "p",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                        params: [],
                        order_by: [],
                        window: None,
                        lambda: None,
                    },
                },
            },
        },
    },
)


---------- Input ----------
CREATE OR REPLACE FUNCTION isnotempty_test_replace AS(p) -> not(is_null(p))  DESC = 'This is a description';
---------- Output ---------
CREATE OR REPLACE FUNCTION isnotempty_test_replace AS (p) -> NOT is_null(p) DESC = 'This is a description'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateOrReplace,
        udf_name: Identifier {
            span: Some(
                27..50,
            ),
            name: "isnotempty_test_replace",
            quote: None,
            ident_type: None,
        },
        description: Some(
            "This is a description",
        ),
        definition: LambdaUDF {
            parameters: Names(
                [
                    Identifier {
                        span: Some(
                            54..55,
                        ),
                        name: "p",
                        quote: None,
                        ident_type: None,
                    },
                ],
            ),
            definition: UnaryOp {
                span: Some(
                    60..63,
                ),
                op: Not,
                expr: FunctionCall {
                    span: Some(
                        64..74,
                    ),
                    func: FunctionCall {
                        distinct: false,
                        name: Identifier {
                            span: Some(
                                64..71,
                            ),
                            name: "is_null",
                            quote: None,
                            ident_type: None,
                        },
                        args: [
                            ColumnRef {
                                span: Some(
                                    72..73,
                                ),
                                column: ColumnRef {
                                    database: None,
                                    table: None,
                                    column: Name(
                                        Identifier {
                                            span: Some(
                                                72..73,
                                            ),
                                            name: "p",
                                            quote: None,
                                            ident_type: None,
                                        },
                                    ),
                                },
                            },
                        ],
                        params: [],
                        order_by: [],
                        window: None,
                        lambda: None,
                    },
                },
            },
        },
    },
)


---------- Input ----------
CREATE OR REPLACE FUNCTION isnotempty_test_replace (p STRING) RETURNS BOOL AS $$ not(is_null(p)) $$;
---------- Output ---------
CREATE OR REPLACE FUNCTION isnotempty_test_replace (p STRING) RETURNS BOOLEAN AS $$
not(is_null(p))
$$
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateOrReplace,
        udf_name: Identifier {
            span: Some(
                27..50,
            ),
            name: "isnotempty_test_replace",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: ScalarUDF {
            arg_types: [
                (
                    Identifier {
                        span: Some(
                            52..53,
                        ),
                        name: "p",
                        quote: None,
                        ident_type: None,
                    },
                    String,
                ),
            ],
            definition: "not(is_null(p))",
            return_type: Boolean,
        },
    },
)


---------- Input ----------
CREATE FUNCTION binary_reverse (BINARY) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
CREATE FUNCTION binary_reverse ( BINARY ) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: Create,
        udf_name: Identifier {
            span: Some(
                16..30,
            ),
            name: "binary_reverse",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFServer {
            arg_types: Types(
                [
                    Binary,
                ],
            ),
            return_type: Binary,
            address: "http://0.0.0.0:8815",
            handler: "binary_reverse",
            headers: {},
            language: "python",
            immutable: None,
        },
    },
)


---------- Input ----------
CREATE FUNCTION binary_reverse (arg0 BINARY) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
CREATE FUNCTION binary_reverse ( arg0 BINARY ) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: Create,
        udf_name: Identifier {
            span: Some(
                16..30,
            ),
            name: "binary_reverse",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFServer {
            arg_types: NameWithTypes(
                [
                    (
                        Identifier {
                            span: Some(
                                32..36,
                            ),
                            name: "arg0",
                            quote: None,
                            ident_type: None,
                        },
                        Binary,
                    ),
                ],
            ),
            return_type: Binary,
            address: "http://0.0.0.0:8815",
            handler: "binary_reverse",
            headers: {},
            language: "python",
            immutable: None,
        },
    },
)


---------- Input ----------
CREATE FUNCTION binary_reverse (BINARY) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' HEADERS = ('X-Authorization' = '123') ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
CREATE FUNCTION binary_reverse ( BINARY ) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' HEADERS = ('X-Authorization' = '123') ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: Create,
        udf_name: Identifier {
            span: Some(
                16..30,
            ),
            name: "binary_reverse",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFServer {
            arg_types: Types(
                [
                    Binary,
                ],
            ),
            return_type: Binary,
            address: "http://0.0.0.0:8815",
            handler: "binary_reverse",
            headers: {
                "X-Authorization": "123",
            },
            language: "python",
            immutable: None,
        },
    },
)


---------- Input ----------
CREATE FUNCTION binary_reverse_table () RETURNS TABLE (c1 int) AS $$ select * from binary_reverse $$;
---------- Output ---------
CREATE FUNCTION binary_reverse_table () RETURNS TABLE (c1 Int32) AS $$
select * from binary_reverse
$$
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: Create,
        udf_name: Identifier {
            span: Some(
                16..36,
            ),
            name: "binary_reverse_table",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDTFSql {
            arg_types: [],
            return_types: [
                (
                    Identifier {
                        span: Some(
                            55..57,
                        ),
                        name: "c1",
                        quote: None,
                        ident_type: None,
                    },
                    Int32,
                ),
            ],
            sql: "select * from binary_reverse",
        },
    },
)


---------- Input ----------
ALTER FUNCTION binary_reverse (BINARY) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
ALTER FUNCTION binary_reverse ( BINARY ) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
AlterUDF(
    AlterUDFStmt {
        udf_name: Identifier {
            span: Some(
                15..29,
            ),
            name: "binary_reverse",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFServer {
            arg_types: Types(
                [
                    Binary,
                ],
            ),
            return_type: Binary,
            address: "http://0.0.0.0:8815",
            handler: "binary_reverse",
            headers: {},
            language: "python",
            immutable: None,
        },
    },
)


---------- Input ----------
CREATE OR REPLACE FUNCTION binary_reverse (BINARY) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
CREATE OR REPLACE FUNCTION binary_reverse ( BINARY ) RETURNS BINARY LANGUAGE python HANDLER = 'binary_reverse' ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateOrReplace,
        udf_name: Identifier {
            span: Some(
                27..41,
            ),
            name: "binary_reverse",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFServer {
            arg_types: Types(
                [
                    Binary,
                ],
            ),
            return_type: Binary,
            address: "http://0.0.0.0:8815",
            handler: "binary_reverse",
            headers: {},
            language: "python",
            immutable: None,
        },
    },
)


---------- Input ----------
CREATE file format my_orc type = orc
---------- Output ---------
CREATE FILE FORMAT my_orc type = orc
---------- AST ------------
CreateFileFormat {
    create_option: Create,
    name: "my_orc",
    file_format_options: FileFormatOptions {
        options: {
            "type": Keyword(
                "orc",
            ),
        },
    },
}


---------- Input ----------
CREATE file format my_orc type = orc missing_field_as=field_default
---------- Output ---------
CREATE FILE FORMAT my_orc missing_field_as = field_default, type = orc
---------- AST ------------
CreateFileFormat {
    create_option: Create,
    name: "my_orc",
    file_format_options: FileFormatOptions {
        options: {
            "missing_field_as": Keyword(
                "field_default",
            ),
            "type": Keyword(
                "orc",
            ),
        },
    },
}


---------- Input ----------
CREATE file format my_orc type = orc missing_field_as='field_default'
---------- Output ---------
CREATE FILE FORMAT my_orc missing_field_as = 'field_default', type = orc
---------- AST ------------
CreateFileFormat {
    create_option: Create,
    name: "my_orc",
    file_format_options: FileFormatOptions {
        options: {
            "missing_field_as": String(
                "field_default",
            ),
            "type": Keyword(
                "orc",
            ),
        },
    },
}


---------- Input ----------
CREATE STAGE s file_format=(record_delimiter='\n' escape='\\');
---------- Output ---------
CREATE STAGE s FILE_FORMAT = (escape = '\\', record_delimiter = '\n')
---------- AST ------------
CreateStage(
    CreateStageStmt {
        create_option: Create,
        stage_name: "s",
        location: None,
        file_format_options: FileFormatOptions {
            options: {
                "escape": String(
                    "\\",
                ),
                "record_delimiter": String(
                    "\n",
                ),
            },
        },
        comments: "",
    },
)


---------- Input ----------
create or replace function addone(int)
returns int
language python
handler = 'addone_py'
as
$$
def addone_py(i):
return i+1
$$;
---------- Output ---------
CREATE OR REPLACE FUNCTION addone ( Int32 ) RETURNS Int32 LANGUAGE python IMPORTS = () PACKAGES = () HANDLER = 'addone_py' AS $$
def addone_py(i):
return i+1
$$
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateOrReplace,
        udf_name: Identifier {
            span: Some(
                27..33,
            ),
            name: "addone",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFScript {
            arg_types: Types(
                [
                    Int32,
                ],
            ),
            return_type: Int32,
            code: "def addone_py(i):\nreturn i+1",
            imports: [],
            packages: [],
            handler: "addone_py",
            language: "python",
            runtime_version: "",
            immutable: None,
        },
    },
)


---------- Input ----------
create or replace function addone(int)
returns int
language python
imports = ('@ss/abc')
packages = ('numpy', 'pandas')
handler = 'addone_py'
as '@data/abc/a.py';
---------- Output ---------
CREATE OR REPLACE FUNCTION addone ( Int32 ) RETURNS Int32 LANGUAGE python IMPORTS = ('@ss/abc') PACKAGES = ('numpy','pandas') HANDLER = 'addone_py' AS $$
@data/abc/a.py
$$
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateOrReplace,
        udf_name: Identifier {
            span: Some(
                27..33,
            ),
            name: "addone",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDFScript {
            arg_types: Types(
                [
                    Int32,
                ],
            ),
            return_type: Int32,
            code: "@data/abc/a.py",
            imports: [
                "@ss/abc",
            ],
            packages: [
                "numpy",
                "pandas",
            ],
            handler: "addone_py",
            language: "python",
            runtime_version: "",
            immutable: None,
        },
    },
)


---------- Input ----------
DROP FUNCTION binary_reverse;
---------- Output ---------
DROP FUNCTION binary_reverse
---------- AST ------------
DropUDF {
    if_exists: false,
    udf_name: Identifier {
        span: Some(
            14..28,
        ),
        name: "binary_reverse",
        quote: None,
        ident_type: None,
    },
}


---------- Input ----------
DROP FUNCTION isnotempty;
---------- Output ---------
DROP FUNCTION isnotempty
---------- AST ------------
DropUDF {
    if_exists: false,
    udf_name: Identifier {
        span: Some(
            14..24,
        ),
        name: "isnotempty",
        quote: None,
        ident_type: None,
    },
}


---------- Input ----------
CREATE FUNCTION IF NOT EXISTS my_agg (INT) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
CREATE FUNCTION IF NOT EXISTS my_agg ( Int32 ) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateIfNotExists,
        udf_name: Identifier {
            span: Some(
                30..36,
            ),
            name: "my_agg",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDAFServer {
            arg_types: Types(
                [
                    Int32,
                ],
            ),
            state_fields: [
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            51..52,
                        ),
                        name: "s",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: String,
                },
            ],
            return_type: Boolean,
            address: "http://0.0.0.0:8815",
            headers: {},
            language: "javascript",
        },
    },
)


---------- Input ----------
CREATE FUNCTION IF NOT EXISTS my_agg (INT) STATE { s STRING, i INT NOT NULL } RETURNS BOOLEAN LANGUAGE javascript AS 'some code';
---------- Output ---------
CREATE FUNCTION IF NOT EXISTS my_agg ( Int32 ) STATE { s STRING, i Int32 NOT NULL } RETURNS BOOLEAN LANGUAGE javascript IMPORTS = () PACKAGES = () AS $$
some code
$$
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateIfNotExists,
        udf_name: Identifier {
            span: Some(
                30..36,
            ),
            name: "my_agg",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDAFScript {
            arg_types: Types(
                [
                    Int32,
                ],
            ),
            state_fields: [
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            51..52,
                        ),
                        name: "s",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: String,
                },
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            61..62,
                        ),
                        name: "i",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: NotNull(
                        Int32,
                    ),
                },
            ],
            return_type: Boolean,
            imports: [],
            packages: [],
            code: "some code",
            language: "javascript",
            runtime_version: "",
        },
    },
)


---------- Input ----------
CREATE FUNCTION IF NOT EXISTS my_agg (a INT) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript ADDRESS = 'http://0.0.0.0:8815';
---------- Output ---------
CREATE FUNCTION IF NOT EXISTS my_agg ( a Int32 ) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript ADDRESS = 'http://0.0.0.0:8815'
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateIfNotExists,
        udf_name: Identifier {
            span: Some(
                30..36,
            ),
            name: "my_agg",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDAFServer {
            arg_types: NameWithTypes(
                [
                    (
                        Identifier {
                            span: Some(
                                38..39,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        Int32,
                    ),
                ],
            ),
            state_fields: [
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            53..54,
                        ),
                        name: "s",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: String,
                },
            ],
            return_type: Boolean,
            address: "http://0.0.0.0:8815",
            headers: {},
            language: "javascript",
        },
    },
)


---------- Input ----------
CREATE FUNCTION IF NOT EXISTS my_agg (a INT) STATE { s STRING, i INT NOT NULL } RETURNS BOOLEAN LANGUAGE javascript AS 'some code';
---------- Output ---------
CREATE FUNCTION IF NOT EXISTS my_agg ( a Int32 ) STATE { s STRING, i Int32 NOT NULL } RETURNS BOOLEAN LANGUAGE javascript IMPORTS = () PACKAGES = () AS $$
some code
$$
---------- AST ------------
CreateUDF(
    CreateUDFStmt {
        create_option: CreateIfNotExists,
        udf_name: Identifier {
            span: Some(
                30..36,
            ),
            name: "my_agg",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDAFScript {
            arg_types: NameWithTypes(
                [
                    (
                        Identifier {
                            span: Some(
                                38..39,
                            ),
                            name: "a",
                            quote: None,
                            ident_type: None,
                        },
                        Int32,
                    ),
                ],
            ),
            state_fields: [
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            53..54,
                        ),
                        name: "s",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: String,
                },
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            63..64,
                        ),
                        name: "i",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: NotNull(
                        Int32,
                    ),
                },
            ],
            return_type: Boolean,
            imports: [],
            packages: [],
            code: "some code",
            language: "javascript",
            runtime_version: "",
        },
    },
)


---------- Input ----------
ALTER FUNCTION my_agg (INT) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript AS 'some code';
---------- Output ---------
ALTER FUNCTION my_agg ( Int32 ) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript IMPORTS = () PACKAGES = () AS $$
some code
$$
---------- AST ------------
AlterUDF(
    AlterUDFStmt {
        udf_name: Identifier {
            span: Some(
                15..21,
            ),
            name: "my_agg",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: UDAFScript {
            arg_types: Types(
                [
                    Int32,
                ],
            ),
            state_fields: [
                UDAFStateField {
                    name: Identifier {
                        span: Some(
                            36..37,
                        ),
                        name: "s",
                        quote: None,
                        ident_type: None,
                    },
                    type_name: String,
                },
            ],
            return_type: Boolean,
            imports: [],
            packages: [],
            code: "some code",
            language: "javascript",
            runtime_version: "",
        },
    },
)


---------- Input ----------
EXECUTE IMMEDIATE
$$
BEGIN
    LOOP
        RETURN 1;
    END LOOP;
END;
$$
---------- Output ---------
EXECUTE IMMEDIATE 'BEGIN\n    LOOP\n        RETURN 1;\n    END LOOP;\nEND;'
---------- AST ------------
ExecuteImmediate(
    ExecuteImmediateStmt {
        script: Literal {
            span: Some(
                18..75,
            ),
            value: String(
                "BEGIN\n    LOOP\n        RETURN 1;\n    END LOOP;\nEND;",
            ),
        },
    },
)


---------- Input ----------
with
abc as (
    select
        id, uid, eid, match_id, created_at, updated_at
    from (
        select * from ddd.ccc where score > 0 limit 10
    )
    qualify row_number() over(partition by uid,eid order by updated_at desc) = 1
)
select * from abc;
---------- Output ---------
WITH abc AS (SELECT id, uid, eid, match_id, created_at, updated_at FROM (SELECT * FROM ddd.ccc WHERE score > 0 LIMIT 10) QUALIFY row_number() OVER (PARTITION BY uid, eid ORDER BY updated_at DESC) = 1) SELECT * FROM abc
---------- AST ------------
Query(
    Query {
        span: Some(
            235..252,
        ),
        with: Some(
            With {
                span: Some(
                    0..234,
                ),
                recursive: false,
                ctes: [
                    CTE {
                        span: Some(
                            5..234,
                        ),
                        alias: TableAlias {
                            name: Identifier {
                                span: Some(
                                    5..8,
                                ),
                                name: "abc",
                                quote: None,
                                ident_type: None,
                            },
                            columns: [],
                        },
                        user_specified_materialized: false,
                        materialized: false,
                        query: Query {
                            span: Some(
                                18..232,
                            ),
                            with: None,
                            body: Select(
                                SelectStmt {
                                    span: Some(
                                        18..232,
                                    ),
                                    hints: None,
                                    distinct: false,
                                    top_n: None,
                                    select_list: [
                                        AliasedExpr {
                                            expr: ColumnRef {
                                                span: Some(
                                                    33..35,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                33..35,
                                                            ),
                                                            name: "id",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            alias: None,
                                        },
                                        AliasedExpr {
                                            expr: ColumnRef {
                                                span: Some(
                                                    37..40,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                37..40,
                                                            ),
                                                            name: "uid",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            alias: None,
                                        },
                                        AliasedExpr {
                                            expr: ColumnRef {
                                                span: Some(
                                                    42..45,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                42..45,
                                                            ),
                                                            name: "eid",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            alias: None,
                                        },
                                        AliasedExpr {
                                            expr: ColumnRef {
                                                span: Some(
                                                    47..55,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                47..55,
                                                            ),
                                                            name: "match_id",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            alias: None,
                                        },
                                        AliasedExpr {
                                            expr: ColumnRef {
                                                span: Some(
                                                    57..67,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                57..67,
                                                            ),
                                                            name: "created_at",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            alias: None,
                                        },
                                        AliasedExpr {
                                            expr: ColumnRef {
                                                span: Some(
                                                    69..79,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                69..79,
                                                            ),
                                                            name: "updated_at",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            alias: None,
                                        },
                                    ],
                                    from: [
                                        Subquery {
                                            span: Some(
                                                89..151,
                                            ),
                                            lateral: false,
                                            subquery: Query {
                                                span: Some(
                                                    99..136,
                                                ),
                                                with: None,
                                                body: Select(
                                                    SelectStmt {
                                                        span: Some(
                                                            99..136,
                                                        ),
                                                        hints: None,
                                                        distinct: false,
                                                        top_n: None,
                                                        select_list: [
                                                            StarColumns {
                                                                qualified: [
                                                                    Star(
                                                                        Some(
                                                                            106..107,
                                                                        ),
                                                                    ),
                                                                ],
                                                                column_filter: None,
                                                            },
                                                        ],
                                                        from: [
                                                            Table {
                                                                span: Some(
                                                                    113..120,
                                                                ),
                                                                catalog: None,
                                                                database: Some(
                                                                    Identifier {
                                                                        span: Some(
                                                                            113..116,
                                                                        ),
                                                                        name: "ddd",
                                                                        quote: None,
                                                                        ident_type: None,
                                                                    },
                                                                ),
                                                                table: Identifier {
                                                                    span: Some(
                                                                        117..120,
                                                                    ),
                                                                    name: "ccc",
                                                                    quote: None,
                                                                    ident_type: None,
                                                                },
                                                                alias: None,
                                                                temporal: None,
                                                                with_options: None,
                                                                pivot: None,
                                                                unpivot: None,
                                                                sample: None,
                                                            },
                                                        ],
                                                        selection: Some(
                                                            BinaryOp {
                                                                span: Some(
                                                                    133..134,
                                                                ),
                                                                op: Gt,
                                                                left: ColumnRef {
                                                                    span: Some(
                                                                        127..132,
                                                                    ),
                                                                    column: ColumnRef {
                                                                        database: None,
                                                                        table: None,
                                                                        column: Name(
                                                                            Identifier {
                                                                                span: Some(
                                                                                    127..132,
                                                                                ),
                                                                                name: "score",
                                                                                quote: None,
                                                                                ident_type: None,
                                                                            },
                                                                        ),
                                                                    },
                                                                },
                                                                right: Literal {
                                                                    span: Some(
                                                                        135..136,
                                                                    ),
                                                                    value: UInt64(
                                                                        0,
                                                                    ),
                                                                },
                                                            },
                                                        ),
                                                        group_by: None,
                                                        having: None,
                                                        window_list: None,
                                                        qualify: None,
                                                    },
                                                ),
                                                order_by: [],
                                                limit: [
                                                    Literal {
                                                        span: Some(
                                                            143..145,
                                                        ),
                                                        value: UInt64(
                                                            10,
                                                        ),
                                                    },
                                                ],
                                                offset: None,
                                                ignore_result: false,
                                            },
                                            alias: None,
                                            pivot: None,
                                            unpivot: None,
                                        },
                                    ],
                                    selection: None,
                                    group_by: None,
                                    having: None,
                                    window_list: None,
                                    qualify: Some(
                                        BinaryOp {
                                            span: Some(
                                                229..230,
                                            ),
                                            op: Eq,
                                            left: FunctionCall {
                                                span: Some(
                                                    164..228,
                                                ),
                                                func: FunctionCall {
                                                    distinct: false,
                                                    name: Identifier {
                                                        span: Some(
                                                            164..174,
                                                        ),
                                                        name: "row_number",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                    args: [],
                                                    params: [],
                                                    order_by: [],
                                                    window: Some(
                                                        WindowDesc {
                                                            ignore_nulls: None,
                                                            window: WindowSpec(
                                                                WindowSpec {
                                                                    existing_window_name: None,
                                                                    partition_by: [
                                                                        ColumnRef {
                                                                            span: Some(
                                                                                195..198,
                                                                            ),
                                                                            column: ColumnRef {
                                                                                database: None,
                                                                                table: None,
                                                                                column: Name(
                                                                                    Identifier {
                                                                                        span: Some(
                                                                                            195..198,
                                                                                        ),
                                                                                        name: "uid",
                                                                                        quote: None,
                                                                                        ident_type: None,
                                                                                    },
                                                                                ),
                                                                            },
                                                                        },
                                                                        ColumnRef {
                                                                            span: Some(
                                                                                199..202,
                                                                            ),
                                                                            column: ColumnRef {
                                                                                database: None,
                                                                                table: None,
                                                                                column: Name(
                                                                                    Identifier {
                                                                                        span: Some(
                                                                                            199..202,
                                                                                        ),
                                                                                        name: "eid",
                                                                                        quote: None,
                                                                                        ident_type: None,
                                                                                    },
                                                                                ),
                                                                            },
                                                                        },
                                                                    ],
                                                                    order_by: [
                                                                        OrderByExpr {
                                                                            expr: ColumnRef {
                                                                                span: Some(
                                                                                    212..222,
                                                                                ),
                                                                                column: ColumnRef {
                                                                                    database: None,
                                                                                    table: None,
                                                                                    column: Name(
                                                                                        Identifier {
                                                                                            span: Some(
                                                                                                212..222,
                                                                                            ),
                                                                                            name: "updated_at",
                                                                                            quote: None,
                                                                                            ident_type: None,
                                                                                        },
                                                                                    ),
                                                                                },
                                                                            },
                                                                            asc: Some(
                                                                                false,
                                                                            ),
                                                                            nulls_first: None,
                                                                        },
                                                                    ],
                                                                    window_frame: None,
                                                                },
                                                            ),
                                                        },
                                                    ),
                                                    lambda: None,
                                                },
                                            },
                                            right: Literal {
                                                span: Some(
                                                    231..232,
                                                ),
                                                value: UInt64(
                                                    1,
                                                ),
                                            },
                                        },
                                    ),
                                },
                            ),
                            order_by: [],
                            limit: [],
                            offset: None,
                            ignore_result: false,
                        },
                    },
                ],
            },
        ),
        body: Select(
            SelectStmt {
                span: Some(
                    235..252,
                ),
                hints: None,
                distinct: false,
                top_n: None,
                select_list: [
                    StarColumns {
                        qualified: [
                            Star(
                                Some(
                                    242..243,
                                ),
                            ),
                        ],
                        column_filter: None,
                    },
                ],
                from: [
                    Table {
                        span: Some(
                            249..252,
                        ),
                        catalog: None,
                        database: None,
                        table: Identifier {
                            span: Some(
                                249..252,
                            ),
                            name: "abc",
                            quote: None,
                            ident_type: None,
                        },
                        alias: None,
                        temporal: None,
                        with_options: None,
                        pivot: None,
                        unpivot: None,
                        sample: None,
                    },
                ],
                selection: None,
                group_by: None,
                having: None,
                window_list: None,
                qualify: None,
            },
        ),
        order_by: [],
        limit: [],
        offset: None,
        ignore_result: false,
    },
)


---------- Input ----------
CREATE OR REPLACE DICTIONARY my_catalog.my_database.my_dictionary
(
    user_name String,
    age Int16
)
PRIMARY KEY username
SOURCE (mysql(host='localhost' username='root' password='1234'))
COMMENT 'This is a comment';
---------- Output ---------
CREATE OR REPLACE DICTIONARY my_catalog.my_database.my_dictionary(user_name STRING, age Int16)PRIMARY KEY username SOURCE(mysql( host = 'localhost' password = '1234' username = 'root'))COMMENT 'This is a comment' 
---------- AST ------------
CreateDictionary(
    CreateDictionaryStmt {
        create_option: CreateOrReplace,
        catalog: Some(
            Identifier {
                span: Some(
                    29..39,
                ),
                name: "my_catalog",
                quote: None,
                ident_type: None,
            },
        ),
        database: Some(
            Identifier {
                span: Some(
                    40..51,
                ),
                name: "my_database",
                quote: None,
                ident_type: None,
            },
        ),
        dictionary_name: Identifier {
            span: Some(
                52..65,
            ),
            name: "my_dictionary",
            quote: None,
            ident_type: None,
        },
        columns: [
            ColumnDefinition {
                name: Identifier {
                    span: Some(
                        72..81,
                    ),
                    name: "user_name",
                    quote: None,
                    ident_type: None,
                },
                data_type: String,
                expr: None,
                check: None,
                comment: None,
            },
            ColumnDefinition {
                name: Identifier {
                    span: Some(
                        94..97,
                    ),
                    name: "age",
                    quote: None,
                    ident_type: None,
                },
                data_type: Int16,
                expr: None,
                check: None,
                comment: None,
            },
        ],
        primary_keys: [
            Identifier {
                span: Some(
                    118..126,
                ),
                name: "username",
                quote: None,
                ident_type: None,
            },
        ],
        source_name: Identifier {
            span: Some(
                135..140,
            ),
            name: "mysql",
            quote: None,
            ident_type: None,
        },
        source_options: {
            "host": "localhost",
            "password": "1234",
            "username": "root",
        },
        comment: Some(
            "This is a comment",
        ),
    },
)


---------- Input ----------
describe PROCEDURE p1()
---------- Output ---------
DESCRIBE PROCEDURE p1()
---------- AST ------------
DescProcedure(
    DescProcedureStmt {
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
    },
)


---------- Input ----------
describe PROCEDURE p1(string, timestamp)
---------- Output ---------
DESCRIBE PROCEDURE p1(STRING,TIMESTAMP)
---------- AST ------------
DescProcedure(
    DescProcedureStmt {
        name: ProcedureIdentity {
            name: "p1",
            args_type: "STRING,TIMESTAMP",
        },
    },
)


---------- Input ----------
drop PROCEDURE p1()
---------- Output ---------
DROP PROCEDURE p1()
---------- AST ------------
DropProcedure(
    DropProcedureStmt {
        if_exists: false,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
    },
)


---------- Input ----------
drop PROCEDURE if exists p1()
---------- Output ---------
DROP PROCEDURE IF EXISTS p1()
---------- AST ------------
DropProcedure(
    DropProcedureStmt {
        if_exists: true,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
    },
)


---------- Input ----------
drop PROCEDURE p1(int, string)
---------- Output ---------
DROP PROCEDURE p1(Int32,STRING)
---------- AST ------------
DropProcedure(
    DropProcedureStmt {
        if_exists: false,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "Int32,STRING",
        },
    },
)


---------- Input ----------
call PROCEDURE p1()
---------- Output ---------
CALL PROCEDURE p1()
---------- AST ------------
CallProcedure(
    CallProcedureStmt {
        name: Identifier {
            span: Some(
                15..17,
            ),
            name: "p1",
            quote: None,
            ident_type: None,
        },
        args: [],
    },
)


---------- Input ----------
call PROCEDURE p1(1, 'x', '2022-02-02'::Date)
---------- Output ---------
CALL PROCEDURE p1(1, 'x', '2022-02-02'::DATE)
---------- AST ------------
CallProcedure(
    CallProcedureStmt {
        name: Identifier {
            span: Some(
                15..17,
            ),
            name: "p1",
            quote: None,
            ident_type: None,
        },
        args: [
            Literal {
                span: Some(
                    18..19,
                ),
                value: UInt64(
                    1,
                ),
            },
            Literal {
                span: Some(
                    21..24,
                ),
                value: String(
                    "x",
                ),
            },
            Cast {
                span: Some(
                    38..44,
                ),
                expr: Literal {
                    span: Some(
                        26..38,
                    ),
                    value: String(
                        "2022-02-02",
                    ),
                },
                target_type: Date,
                pg_style: true,
            },
        ],
    },
)


---------- Input ----------
show PROCEDURES like 'p1%'
---------- Output ---------
SHOW PROCEDURES LIKE 'p1%'
---------- AST ------------
ShowProcedures {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "p1%",
                },
            ),
            limit: None,
        },
    ),
}


---------- Input ----------
create or replace PROCEDURE p1() returns string not null language sql comment = 'test' as $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$;
---------- Output ---------
CREATE OR REPLACE PROCEDURE p1() RETURNS STRING NOT NULL LANGUAGE SQL  COMMENT='test' AS $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$
---------- AST ------------
CreateProcedure(
    CreateProcedureStmt {
        create_option: CreateOrReplace,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
        language: SQL,
        args: None,
        return_type: [
            ProcedureType {
                name: None,
                data_type: NotNull(
                    String,
                ),
            },
        ],
        comment: Some(
            "test",
        ),
        script: "BEGIN\n    LET sum := 0;\n    FOR x IN SELECT * FROM numbers(100) DO\n        sum := sum + x.number;\n    END FOR;\n    RETURN sum;\nEND;",
    },
)


---------- Input ----------
create PROCEDURE if not exists p1() returns string not null language sql comment = 'test' as $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$;
---------- Output ---------
CREATE PROCEDURE IF NOT EXISTS p1() RETURNS STRING NOT NULL LANGUAGE SQL  COMMENT='test' AS $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$
---------- AST ------------
CreateProcedure(
    CreateProcedureStmt {
        create_option: CreateIfNotExists,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
        language: SQL,
        args: None,
        return_type: [
            ProcedureType {
                name: None,
                data_type: NotNull(
                    String,
                ),
            },
        ],
        comment: Some(
            "test",
        ),
        script: "BEGIN\n    LET sum := 0;\n    FOR x IN SELECT * FROM numbers(100) DO\n        sum := sum + x.number;\n    END FOR;\n    RETURN sum;\nEND;",
    },
)


---------- Input ----------
create PROCEDURE p1() returns string not null language sql comment = 'test' as $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$;
---------- Output ---------
CREATE PROCEDURE p1() RETURNS STRING NOT NULL LANGUAGE SQL  COMMENT='test' AS $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$
---------- AST ------------
CreateProcedure(
    CreateProcedureStmt {
        create_option: Create,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
        language: SQL,
        args: None,
        return_type: [
            ProcedureType {
                name: None,
                data_type: NotNull(
                    String,
                ),
            },
        ],
        comment: Some(
            "test",
        ),
        script: "BEGIN\n    LET sum := 0;\n    FOR x IN SELECT * FROM numbers(100) DO\n        sum := sum + x.number;\n    END FOR;\n    RETURN sum;\nEND;",
    },
)


---------- Input ----------
create PROCEDURE p1(a int, b string) returns string not null language sql comment = 'test' as $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$;
---------- Output ---------
CREATE PROCEDURE p1(a Int32, b STRING) RETURNS STRING NOT NULL LANGUAGE SQL  COMMENT='test' AS $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$
---------- AST ------------
CreateProcedure(
    CreateProcedureStmt {
        create_option: Create,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "Int32,STRING",
        },
        language: SQL,
        args: Some(
            [
                ProcedureType {
                    name: Some(
                        "a",
                    ),
                    data_type: Int32,
                },
                ProcedureType {
                    name: Some(
                        "b",
                    ),
                    data_type: String,
                },
            ],
        ),
        return_type: [
            ProcedureType {
                name: None,
                data_type: NotNull(
                    String,
                ),
            },
        ],
        comment: Some(
            "test",
        ),
        script: "BEGIN\n    LET sum := 0;\n    FOR x IN SELECT * FROM numbers(100) DO\n        sum := sum + x.number;\n    END FOR;\n    RETURN sum;\nEND;",
    },
)


---------- Input ----------
create PROCEDURE p1() returns table(a string not null, b int null) language sql comment = 'test' as $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$;
---------- Output ---------
CREATE PROCEDURE p1() RETURNS TABLE(a STRING NOT NULL, b Int32 NULL) LANGUAGE SQL  COMMENT='test' AS $$
BEGIN
    LET sum := 0;
    FOR x IN SELECT * FROM numbers(100) DO
        sum := sum + x.number;
    END FOR;
    RETURN sum;
END;
$$
---------- AST ------------
CreateProcedure(
    CreateProcedureStmt {
        create_option: Create,
        name: ProcedureIdentity {
            name: "p1",
            args_type: "",
        },
        language: SQL,
        args: None,
        return_type: [
            ProcedureType {
                name: Some(
                    "a",
                ),
                data_type: NotNull(
                    String,
                ),
            },
            ProcedureType {
                name: Some(
                    "b",
                ),
                data_type: Nullable(
                    Int32,
                ),
            },
        ],
        comment: Some(
            "test",
        ),
        script: "BEGIN\n    LET sum := 0;\n    FOR x IN SELECT * FROM numbers(100) DO\n        sum := sum + x.number;\n    END FOR;\n    RETURN sum;\nEND;",
    },
)


---------- Input ----------
DROP SEQUENCE IF EXISTS seq
---------- Output ---------
DROP SEQUENCE IF EXISTS seq
---------- AST ------------
DropSequence(
    DropSequenceStmt {
        if_exists: true,
        sequence: Identifier {
            span: Some(
                24..27,
            ),
            name: "seq",
            quote: None,
            ident_type: None,
        },
    },
)


---------- Input ----------
CREATE SEQUENCE seq comment='test'
---------- Output ---------
CREATE SEQUENCE seq COMMENT = 'test'
---------- AST ------------
CreateSequence(
    CreateSequenceStmt {
        create_option: Create,
        sequence: Identifier {
            span: Some(
                16..19,
            ),
            name: "seq",
            quote: None,
            ident_type: None,
        },
        start: None,
        increment: None,
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
CREATE SEQUENCE seq start = 20 INCREMENT = 100 comment='test'
---------- Output ---------
CREATE SEQUENCE seq START = 20 INCREMENT = 100 COMMENT = 'test'
---------- AST ------------
CreateSequence(
    CreateSequenceStmt {
        create_option: Create,
        sequence: Identifier {
            span: Some(
                16..19,
            ),
            name: "seq",
            quote: None,
            ident_type: None,
        },
        start: Some(
            20,
        ),
        increment: Some(
            100,
        ),
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
CREATE SEQUENCE seq start WITH 20 INCREMENT BY 100 comment='test'
---------- Output ---------
CREATE SEQUENCE seq START = 20 INCREMENT = 100 COMMENT = 'test'
---------- AST ------------
CreateSequence(
    CreateSequenceStmt {
        create_option: Create,
        sequence: Identifier {
            span: Some(
                16..19,
            ),
            name: "seq",
            quote: None,
            ident_type: None,
        },
        start: Some(
            20,
        ),
        increment: Some(
            100,
        ),
        comment: Some(
            "test",
        ),
    },
)


---------- Input ----------
DESCRIBE SEQUENCE seq
---------- Output ---------
DESC SEQUENCE seq
---------- AST ------------
DescSequence {
    name: Identifier {
        span: Some(
            18..21,
        ),
        name: "seq",
        quote: None,
        ident_type: None,
    },
}


---------- Input ----------
SHOW SEQUENCES LIKE '%seq%'
---------- Output ---------
SHOW SEQUENCES LIKE '%seq%'
---------- AST ------------
ShowSequences {
    show_options: Some(
        ShowOptions {
            show_limit: Some(
                Like {
                    pattern: "%seq%",
                },
            ),
            limit: None,
        },
    ),
}


---------- Input ----------
ALTER TABLE p1 CONNECTION=(CONNECTION_NAME='test')
---------- Output ---------
ALTER TABLE p1 CONNECTION=(connection_name = 'test')
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..14,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..14,
                ),
                name: "p1",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyConnection {
            new_connection: {
                "connection_name": "test",
            },
        },
    },
)


---------- Input ----------
ALTER table t connection=(access_key_id ='x' secret_access_key ='y' endpoint_url='http://127.0.0.1:9900')
---------- Output ---------
ALTER TABLE t CONNECTION=(access_key_id = 'x' endpoint_url = 'http://127.0.0.1:9900' secret_access_key = 'y')
---------- AST ------------
AlterTable(
    AlterTableStmt {
        if_exists: false,
        table_reference: Table {
            span: Some(
                12..13,
            ),
            catalog: None,
            database: None,
            table: Identifier {
                span: Some(
                    12..13,
                ),
                name: "t",
                quote: None,
                ident_type: None,
            },
            alias: None,
            temporal: None,
            with_options: None,
            pivot: None,
            unpivot: None,
            sample: None,
        },
        action: ModifyConnection {
            new_connection: {
                "access_key_id": "x",
                "endpoint_url": "http://127.0.0.1:9900",
                "secret_access_key": "y",
            },
        },
    },
)


---------- Input ----------
create or replace row access policy rap_it as (empl_id varchar) returns boolean ->
case
    when 'it_admin' = current_role() then true
    else false
end
---------- Output ---------
CREATE OR REPLACE ROW ACCESS POLICY rap_it AS (empl_id STRING) RETURNS BOOLEAN -> CASE WHEN 'it_admin' = current_role() THEN TRUE ELSE FALSE END
---------- AST ------------
CreateRowAccessPolicy(
    CreateRowAccessPolicyStmt {
        create_option: CreateOrReplace,
        name: Identifier {
            span: Some(
                36..42,
            ),
            name: "rap_it",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: RowAccessPolicyDefinition {
            parameters: [
                RowAccessPolicyType {
                    name: "empl_id",
                    data_type: String,
                },
            ],
            definition: Case {
                span: Some(
                    83..153,
                ),
                operand: None,
                conditions: [
                    BinaryOp {
                        span: Some(
                            108..109,
                        ),
                        op: Eq,
                        left: Literal {
                            span: Some(
                                97..107,
                            ),
                            value: String(
                                "it_admin",
                            ),
                        },
                        right: FunctionCall {
                            span: Some(
                                110..124,
                            ),
                            func: FunctionCall {
                                distinct: false,
                                name: Identifier {
                                    span: Some(
                                        110..122,
                                    ),
                                    name: "current_role",
                                    quote: None,
                                    ident_type: None,
                                },
                                args: [],
                                params: [],
                                order_by: [],
                                window: None,
                                lambda: None,
                            },
                        },
                    },
                ],
                results: [
                    Literal {
                        span: Some(
                            130..134,
                        ),
                        value: Boolean(
                            true,
                        ),
                    },
                ],
                else_result: Some(
                    Literal {
                        span: Some(
                            144..149,
                        ),
                        value: Boolean(
                            false,
                        ),
                    },
                ),
            },
        },
    },
)


---------- Input ----------
create or replace row access policy rap_sales_manager_regions_1 as (sales_region varchar) returns boolean ->
    'sales_executive_role' = current_role()
      or exists (
            select 1 from salesmanagerregions
              where sales_manager = current_role()
                and region = sales_region
)
---------- Output ---------
CREATE OR REPLACE ROW ACCESS POLICY rap_sales_manager_regions_1 AS (sales_region STRING) RETURNS BOOLEAN -> 'sales_executive_role' = current_role() OR EXISTS (SELECT 1 FROM salesmanagerregions WHERE sales_manager = current_role() AND region = sales_region)
---------- AST ------------
CreateRowAccessPolicy(
    CreateRowAccessPolicyStmt {
        create_option: CreateOrReplace,
        name: Identifier {
            span: Some(
                36..63,
            ),
            name: "rap_sales_manager_regions_1",
            quote: None,
            ident_type: None,
        },
        description: None,
        definition: RowAccessPolicyDefinition {
            parameters: [
                RowAccessPolicyType {
                    name: "sales_region",
                    data_type: String,
                },
            ],
            definition: BinaryOp {
                span: Some(
                    159..161,
                ),
                op: Or,
                left: BinaryOp {
                    span: Some(
                        136..137,
                    ),
                    op: Eq,
                    left: Literal {
                        span: Some(
                            113..135,
                        ),
                        value: String(
                            "sales_executive_role",
                        ),
                    },
                    right: FunctionCall {
                        span: Some(
                            138..152,
                        ),
                        func: FunctionCall {
                            distinct: false,
                            name: Identifier {
                                span: Some(
                                    138..150,
                                ),
                                name: "current_role",
                                quote: None,
                                ident_type: None,
                            },
                            args: [],
                            params: [],
                            order_by: [],
                            window: None,
                            lambda: None,
                        },
                    },
                },
                right: Exists {
                    span: Some(
                        162..311,
                    ),
                    not: false,
                    subquery: Query {
                        span: Some(
                            183..309,
                        ),
                        with: None,
                        body: Select(
                            SelectStmt {
                                span: Some(
                                    183..309,
                                ),
                                hints: None,
                                distinct: false,
                                top_n: None,
                                select_list: [
                                    AliasedExpr {
                                        expr: Literal {
                                            span: Some(
                                                190..191,
                                            ),
                                            value: UInt64(
                                                1,
                                            ),
                                        },
                                        alias: None,
                                    },
                                ],
                                from: [
                                    Table {
                                        span: Some(
                                            197..216,
                                        ),
                                        catalog: None,
                                        database: None,
                                        table: Identifier {
                                            span: Some(
                                                197..216,
                                            ),
                                            name: "salesmanagerregions",
                                            quote: None,
                                            ident_type: None,
                                        },
                                        alias: None,
                                        temporal: None,
                                        with_options: None,
                                        pivot: None,
                                        unpivot: None,
                                        sample: None,
                                    },
                                ],
                                selection: Some(
                                    BinaryOp {
                                        span: Some(
                                            284..287,
                                        ),
                                        op: And,
                                        left: BinaryOp {
                                            span: Some(
                                                251..252,
                                            ),
                                            op: Eq,
                                            left: ColumnRef {
                                                span: Some(
                                                    237..250,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                237..250,
                                                            ),
                                                            name: "sales_manager",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            right: FunctionCall {
                                                span: Some(
                                                    253..267,
                                                ),
                                                func: FunctionCall {
                                                    distinct: false,
                                                    name: Identifier {
                                                        span: Some(
                                                            253..265,
                                                        ),
                                                        name: "current_role",
                                                        quote: None,
                                                        ident_type: None,
                                                    },
                                                    args: [],
                                                    params: [],
                                                    order_by: [],
                                                    window: None,
                                                    lambda: None,
                                                },
                                            },
                                        },
                                        right: BinaryOp {
                                            span: Some(
                                                295..296,
                                            ),
                                            op: Eq,
                                            left: ColumnRef {
                                                span: Some(
                                                    288..294,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                288..294,
                                                            ),
                                                            name: "region",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                            right: ColumnRef {
                                                span: Some(
                                                    297..309,
                                                ),
                                                column: ColumnRef {
                                                    database: None,
                                                    table: None,
                                                    column: Name(
                                                        Identifier {
                                                            span: Some(
                                                                297..309,
                                                            ),
                                                            name: "sales_region",
                                                            quote: None,
                                                            ident_type: None,
                                                        },
                                                    ),
                                                },
                                            },
                                        },
                                    },
                                ),
                                group_by: None,
                                having: None,
                                window_list: None,
                                qualify: None,
                            },
                        ),
                        order_by: [],
                        limit: [],
                        offset: None,
                        ignore_result: false,
                    },
                },
            },
        },
    },
)


---------- Input ----------
DROP row access policy IF EXISTS r1
---------- Output ---------
DROP ROW ACCESS POLICY IF EXISTS r1
---------- AST ------------
DropRowAccessPolicy(
    DropRowAccessPolicyStmt {
        if_exists: true,
        name: "r1",
    },
)


---------- Input ----------
desc row access policy r1
---------- Output ---------
DESCRIBE ROW ACCESS POLICY r1
---------- AST ------------
DescRowAccessPolicy(
    DescRowAccessPolicyStmt {
        name: "r1",
    },
)


