Skip to content

BigQuery: Fix parsing parameterized data types#3735

Merged
barrywhart merged 6 commits intosqlfluff:mainfrom
yoichi:bq-parameterized-data-types
Aug 14, 2022
Merged

BigQuery: Fix parsing parameterized data types#3735
barrywhart merged 6 commits intosqlfluff:mainfrom
yoichi:bq-parameterized-data-types

Conversation

@yoichi
Copy link
Copy Markdown
Contributor

@yoichi yoichi commented Aug 12, 2022

Brief summary of the change made

Support parameterized data types (https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types?hl=en#parameterized_data_types)

Fixes #3663

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.

@yoichi yoichi force-pushed the bq-parameterized-data-types branch from 5e0b941 to e5ac55e Compare August 12, 2022 13:07
Comment thread src/sqlfluff/dialects/dialect_bigquery.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 12, 2022

Codecov Report

Merging #3735 (a17d80d) into main (39dc2d8) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #3735   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          176       176           
  Lines        13466     13466           
=========================================
  Hits         13466     13466           
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_bigquery.py 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Bracketed(
Sequence(
Ref("DatatypeSegment"),
Bracketed(Anything(), optional=True), # For types like STRING(10)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Finally deleted the comment. STRING(10) is no longer a good example, as I made it Delimited because I needed to support the NUMERIC(5, 2) format. On the other hand, setting the example to NUMERIC(5, 2) is misleading in relation to "Numeric"LiteralSegment.

Comment thread src/sqlfluff/dialects/dialect_bigquery.py Outdated
@barrywhart barrywhart merged commit bc14733 into sqlfluff:main Aug 14, 2022
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.

Bigquery: Parsing error when declaring arrays

2 participants