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

Dialect: DuckDB "LOAD spatial;" causes indentation rules to not be enforced #882

Closed
gregorywaynepower opened this issue Oct 17, 2024 · 6 comments

Comments

@gregorywaynepower
Copy link

Hey folks! I'm currently using sqruff 0.19.1 installed via cargo on Windows 10 working with the DuckDB dialect. For some reason a LOAD spatial; is throwing off the rest of my linting rules.

LOAD spatial;

-- SUMMARIZE cpd_incidents;
-- DESCRIBE cpd_incidents;

SELECT location FROM cpd_incidents LIMIT 1;

SELECT
    crimeday AS "Crime Day",
    count(crimeday) AS "Crime Count"
FROM
    cpd_incidents
WHERE
    crimeday IS NOT NULL
GROUP BY
    crimeday
ORDER BY
    "Crime Count" DESC;

Becomes

LOAD spatial ;

-- SUMMARIZE cpd_incidents;
-- DESCRIBE cpd_incidents;

SELECT location FROM cpd_incidents LIMIT 1 ;

SELECT
crimeday AS "Crime Day",
count (crimeday) AS "Crime Count"
FROM
cpd_incidents
WHERE
crimeday IS NOT NULL
GROUP BY
crimeday
ORDER BY
"Crime Count" DESC ;

When I remove the LOAD spatial; my linting rules are parsed properly.

-- LOAD spatial;

-- SUMMARIZE cpd_incidents;
-- DESCRIBE cpd_incidents;

SELECT location FROM cpd_incidents LIMIT 1;

SELECT
    crimeday AS "Crime Day",
    count(crimeday) AS "Crime Count"
FROM
    cpd_incidents
WHERE
    crimeday IS NOT NULL
GROUP BY
    crimeday
ORDER BY
    "Crime Count" DESC;

@benfdking
Copy link
Collaborator

This is probably because at the moment we don't support the load syntax.

@gregorywaynepower
Copy link
Author

That's valid--it's very much a feature that has seen its fare share of changes in DuckDB.

benfdking added a commit that referenced this issue Oct 21, 2024
benfdking added a commit that referenced this issue Nov 23, 2024
benfdking added a commit that referenced this issue Nov 24, 2024
benfdking added a commit that referenced this issue Nov 24, 2024
benfdking added a commit that referenced this issue Nov 24, 2024
@benfdking
Copy link
Collaborator

Load is fixed and pushed. I'll do SUMMARIZE and DESCRIBE next.

@gregorywaynepower
Copy link
Author

Thanks @benfdking!

@benfdking
Copy link
Collaborator

Those are fixed and being pushed in release 0.21.3

@benfdking
Copy link
Collaborator

Hey @gregorywaynepower, I am going to close this. Let us know if you have any issues.

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

No branches or pull requests

2 participants