---
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/ok/alter_aggregate.sql
---
SOURCE_FILE
  COMMENT "-- star"
  WHITESPACE "\n"
  ALTER_AGGREGATE
    ALTER_KW "alter"
    WHITESPACE " "
    AGGREGATE_KW "aggregate"
    WHITESPACE " "
    AGGREGATE
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "a"
      WHITESPACE " "
      PARAM_LIST
        L_PAREN "("
        STAR "*"
        R_PAREN ")"
    WHITESPACE " "
    RENAME_TO
      RENAME_KW "rename"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      NAME
        IDENT "b"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- simple_args"
  WHITESPACE "\n"
  ALTER_AGGREGATE
    ALTER_KW "alter"
    WHITESPACE " "
    AGGREGATE_KW "aggregate"
    WHITESPACE " "
    AGGREGATE
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "a"
      WHITESPACE " "
      PARAM_LIST
        L_PAREN "("
        PARAM
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "t"
        R_PAREN ")"
    WHITESPACE " "
    SET_SCHEMA
      SET_KW "set"
      WHITESPACE " "
      SCHEMA_KW "schema"
      WHITESPACE " "
      NAME_REF
        IDENT "s"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- complex_args"
  WHITESPACE "\n"
  ALTER_AGGREGATE
    ALTER_KW "alter"
    WHITESPACE " "
    AGGREGATE_KW "aggregate"
    WHITESPACE " "
    AGGREGATE
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "a"
      WHITESPACE " "
      PARAM_LIST
        L_PAREN "("
        PARAM
          PARAM_IN
            IN_KW "in"
          WHITESPACE " "
          NAME
            IDENT "x"
          WHITESPACE " "
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  TEXT_KW "text"
        COMMA ","
        WHITESPACE " "
        PARAM
          NAME
            IDENT "y"
          WHITESPACE " "
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  NUMERIC_KW "numeric"
        R_PAREN ")"
    WHITESPACE " \n    "
    OWNER_TO
      OWNER_KW "owner"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      ROLE_REF
        CURRENT_USER_KW "current_user"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- with_order_by"
  WHITESPACE "\n"
  ALTER_AGGREGATE
    ALTER_KW "alter"
    WHITESPACE " "
    AGGREGATE_KW "aggregate"
    WHITESPACE " "
    AGGREGATE
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "a"
      WHITESPACE " "
      PARAM_LIST
        L_PAREN "("
        PARAM
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "x"
        WHITESPACE " "
        ORDER_KW "order"
        WHITESPACE " "
        BY_KW "by"
        WHITESPACE " "
        PARAM
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "y"
        R_PAREN ")"
    WHITESPACE " \n    "
    RENAME_TO
      RENAME_KW "rename"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      NAME
        IDENT "b"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- qualified_names"
  WHITESPACE "\n"
  ALTER_AGGREGATE
    ALTER_KW "alter"
    WHITESPACE " "
    AGGREGATE_KW "aggregate"
    WHITESPACE " "
    AGGREGATE
      PATH
        PATH
          PATH_SEGMENT
            NAME_REF
              IDENT "foo"
        DOT "."
        PATH_SEGMENT
          NAME_REF
            IDENT "bar"
      WHITESPACE " "
      PARAM_LIST
        L_PAREN "("
        PARAM
          PARAM_IN
            IN_KW "in"
          WHITESPACE " "
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "t"
        COMMA ","
        WHITESPACE " "
        PARAM
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "u"
        R_PAREN ")"
    WHITESPACE " \n    "
    SET_SCHEMA
      SET_KW "set"
      WHITESPACE " "
      SCHEMA_KW "schema"
      WHITESPACE " "
      NAME_REF
        IDENT "new_schema"
  SEMICOLON ";"
  WHITESPACE "\n\n"
