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

[Vertica] fix gaps for some datatypes, complex alias support, fix group by for DDL #5691

Merged
merged 9 commits into from Mar 21, 2024

Conversation

PolitePp
Copy link
Contributor

Brief summary of the change made

fixes #5687

  1. fix float with precision
  2. fix aliasing indentations
  3. support aliasing for several columns in some functions
  4. support array[data_type] syntax
  5. allow over and within group in the same window function
  6. fix interval datatype
  7. fix numeric data types (no space between a type and a bracket)
  8. fix group by in partition by clause for create table command

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

No

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.

Copy link
Contributor

github-actions bot commented Mar 19, 2024

Coverage Results ✅

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

225 files skipped due to complete coverage.

@coveralls
Copy link

coveralls commented Mar 19, 2024

Coverage Status

coverage: 99.984%. remained the same
when pulling b715fe1 on PolitePp:issue-5687
into b2a4eab on sqlfluff:main.

gpa
FROM students
WHERE major = ARRAY[row('Science', 'Physics')];
-- Need to add support for complex datatypes
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a regression?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's true, but if you try to use row datatype not inside array it will fail because it's not implemented, so it seems better to have more specific array support and later add a row datatype

Current changes in the array segment allow me to parse sections with Jinja like:

select
    array[
    {% for metric_event in funnel_events %}
        {% for window_size in window_sizes %}
            null,
        {% endfor %}
    {% endfor %}
    null
]::array[varchar] as agg_data
from tab;

Without new changes, it will violate rule RF06 Missing quoted keyword identifier varchar

Copy link
Member

@alanmcruickshank alanmcruickshank left a comment

Choose a reason for hiding this comment

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

Looks sensible. Thanks for checking into the potential regression, but on balance it seems reasonable for now.

@alanmcruickshank alanmcruickshank added this pull request to the merge queue Mar 21, 2024
Merged via the queue into sqlfluff:main with commit 41a63f4 Mar 21, 2024
27 checks passed
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.

[Vertica] fix dialect mistakes
4 participants