Skip to content

Support current spec of aggregate function calls #88

@apstndb

Description

@apstndb

Aggregate function calls have several optional clauses.
https://cloud.google.com/spanner/docs/reference/standard-sql/aggregate-function-calls

function_name(
  [ DISTINCT ]
  function_arguments
  [ { IGNORE | RESPECT } NULLS ]
  [ HAVING { MAX | MIN } having_expression ]
)

I think

  • {IGNORE | RESPECT } NULLS
  • HAVING {MAX | MIN}
    are missing in memefish.
$ go run ./tools/parse --mode statement 'SELECT ARRAY_AGG(x IGNORE NULLS)'        
2024/08/21 18:08:23 syntax error::1:20: expected token: ), but: IGNORE

  1:  SELECT ARRAY_AGG(x IGNORE NULLS)
                         ^~~~~~
exit status 1
$ go run ./tools/parse --mode statement 'SELECT ANY_VALUE(year HAVING MAX inches)'
2024/08/21 18:07:17 syntax error::1:23: expected token: ), but: HAVING

  1:  SELECT ANY_VALUE(year HAVING MAX inches)
                            ^~~~~~
exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions