Skip to content

Regression: spacing rules for functions #6428

@pp-gborodin

Description

@pp-gborodin

Search before asking

  • I searched the issues and found no similar issues.

What Happened

I have this spark sql query

select /*+ repartition(200) */
    one,
    two
from
    mytable

and starting from commit 18293ce sqlfluff is failing with

== [query.sql] FAIL                                                                                                                                                                                    
L:   1 | P:  23 | LT01 | Expected single whitespace between function name
                       | identifier and start bracket '('.
                       | [layout.spacing]

Expected Behaviour

I expect sqlfluff to ignore spacing in the query comments. Or there should be an option to disable this behavior

Observed Behaviour

sqlfluff is failing with

== [query.sql] FAIL                                                                                                                                                                                    
L:   1 | P:  23 | LT01 | Expected single whitespace between function name
                       | identifier and start bracket '('.
                       | [layout.spacing]

How to reproduce

Create file query.sql:

select /*+ repartition(200) */
    one,
    two
from
    mytable

Then execute

git checkout 18293ce419e9605e978e47b7f3e83fd7543f4818
uv venv
uv pip install .
uv run sqlfluff lint --dialect sparksql ./query.sql 

Dialect

sparksql

Version

version 3.1.1 didn't have the issue, version 3.2.0 is the first release that has the issue
I bisected the problem to commit 18293ce

Configuration

default

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsparksqlRelated to the SparkSQL (aka Spark3) dialect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions