Skip to content

Add support for ANY_VALUE( _ HAVING MIN/MAX _ ) to BigQuery dialect - #5321

Merged
alanmcruickshank merged 1 commit into
sqlfluff:mainfrom
ebonnal:bonnal-enzo/add_having_min_max_to_bigquery_dialect
Oct 16, 2023
Merged

alanmcruickshank merged 1 commit into
sqlfluff:mainfrom
ebonnal:bonnal-enzo/add_having_min_max_to_bigquery_dialect

Conversation

@ebonnal

@ebonnal ebonnal commented Oct 14, 2023 •

Copy link
Copy Markdown
Contributor

Brief summary of the change made

These changes make the BigQuery dialect support the HAVING MIN and HAVING MAX function contents, allowed inside the ANY_VALUE aggregate function.

  • It adds this syntax as an alternative in the FunctionContentsExpressionGrammar node.
  • It adds MIN and MAX into bigquery_unreserved_keywords
  • It adds a test statement inside test/fixtures/dialects

Are there any other side effects of this change that we should be aware of?

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@ebonnal
ebonnal force-pushed the bonnal-enzo/add_having_min_max_to_bigquery_dialect branch from 573c7b1 to 41d9807 Compare October 14, 2023 00:46
@ebonnal
ebonnal marked this pull request as ready for review October 14, 2023 00:49
@ebonnal ebonnal changed the title Add support for ANY_VALUE HAVING MIN/MAX to BigQuery dialect Add support for ANY_VALUE( _ HAVING MIN/MAX _ ) to BigQuery dialect Oct 16, 2023

@alanmcruickshank alanmcruickshank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really clear. The test suite hasn't run yet, but assuming no issues there, this looks great! 👍 Thanks for contributing.

@alanmcruickshank
alanmcruickshank added this pull request to the merge queue Oct 16, 2023
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same when pulling 41d9807 on bonnal-enzo:bonnal-enzo/add_having_min_max_to_bigquery_dialect into 2447559 on sqlfluff:main.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results ✅

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL   16748      0   100%

219 files skipped due to complete coverage.

Merged via the queue into sqlfluff:main with commit 7dcee95 Oct 16, 2023
@ebonnal ebonnal changed the title Add support for ANY_VALUE( _ HAVING MIN/MAX _ ) to BigQuery dialect Add support for ANY_VALUE( _ HAVING MIN/MAX _ ) to BigQuery dialect Mar 19, 2025
rubytobi pushed a commit to tobycraft/sqlfluff that referenced this pull request Jun 16, 2026
benfdking pushed a commit to quarylabs/sqruff that referenced this pull request Aug 29, 2026
…321)

## Summary
- Advance `.sqlfluff-sha` to 7dcee95f045a671a85e5246da380b9517ffdb4a1.
- SQLFluff #5321 adds BigQuery support for `ANY_VALUE( _ HAVING MIN/MAX _ )`.
  The grammar (`FunctionContentsExpressionGrammar`), the `MIN`/`MAX` keywords,
  and the `any_value_having` parse fixtures are already present in sqruff, so
  only the SHA needed to advance.

Ported from SQLFluff 7dcee95f045a671a85e5246da380b9517ffdb4a1
sqlfluff/sqlfluff#5321
sqlfluff/sqlfluff@7dcee95
benfdking added a commit to quarylabs/sqruff that referenced this pull request Aug 29, 2026
…321) (#3372)

## Summary
- Advance `.sqlfluff-sha` to 7dcee95f045a671a85e5246da380b9517ffdb4a1.
- SQLFluff #5321 adds BigQuery support for `ANY_VALUE( _ HAVING MIN/MAX _ )`.
  The grammar (`FunctionContentsExpressionGrammar`), the `MIN`/`MAX` keywords,
  and the `any_value_having` parse fixtures are already present in sqruff, so
  only the SHA needed to advance.

Ported from SQLFluff 7dcee95f045a671a85e5246da380b9517ffdb4a1
sqlfluff/sqlfluff#5321
sqlfluff/sqlfluff@7dcee95

Co-authored-by: Claude <[email protected]>
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 this pull request may close these issues.

3 participants