Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support current spec of aggregate function calls #88

Closed
apstndb opened this issue Aug 21, 2024 · 0 comments · Fixed by #154
Closed

Support current spec of aggregate function calls #88

apstndb opened this issue Aug 21, 2024 · 0 comments · Fixed by #154

Comments

@apstndb
Copy link
Contributor

apstndb commented Aug 21, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant