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

Snowflake ASOF JOIN compatibility with SQL Format #5885

Open
2 of 3 tasks
mattxxi opened this issue May 17, 2024 · 0 comments
Open
2 of 3 tasks

Snowflake ASOF JOIN compatibility with SQL Format #5885

mattxxi opened this issue May 17, 2024 · 0 comments
Labels
bug Something isn't working snowflake Issues related to the Snowflake dialect

Comments

@mattxxi
Copy link

mattxxi commented May 17, 2024

Search before asking

  • I searched the issues and found no similar issues.

What Happened

Incompability with shandy-sqlfmt 0.21.3

Here is an example of a join:
select *
from table1 as tb1
asof join table2 as tb2 match_condition(t1>t2) on pk1 = pk2

After match_condition( sqlfluff create a space between match_condition and the parenthesis but sqlfmt wants to remove it.
So far to make it work I had to had:
-- sqlfluff:layout:type:start_bracket:spacing_before:any

Expected Behaviour

Should not add a space after match_condition

Observed Behaviour

match_condition( --> vcc match_condition (

How to reproduce

Juste create a query such as:
select *
from table1 as tb1
asof join table2 as tb2 match_condition(t1>t2) on pk1 = pk2

Dialect

snowflake

Version

3.0.6

Configuration

[tool.sqlfluff.core]
dialect = "snowflake"
templater = "dbt"
exclude_rules = "layout.indent, layout.cte_bracket, layout.select_targets, aliasing.expression, references.keywords, layout.cte_newline, structure.column_order, convention.casting_style"
max_line_length = 121
large_file_skip_byte_limit = 0

[tool.sqlfluff.rules]
capitalisation_policy = "lower"
extended_capitalisation_policy = "lower"

[tool.sqlfluff.rules.convention.terminator]
multiline_newline = true

Ignore:
target
dbt_packages

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

@mattxxi mattxxi added the bug Something isn't working label May 17, 2024
@github-actions github-actions bot added the snowflake Issues related to the Snowflake dialect label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working snowflake Issues related to the Snowflake dialect
Projects
None yet
Development

No branches or pull requests

1 participant