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

SparkSQL numeric & fractional literals not supported #640

Closed
ShaneMazur opened this issue Nov 8, 2024 · 1 comment · Fixed by #646
Closed

SparkSQL numeric & fractional literals not supported #640

ShaneMazur opened this issue Nov 8, 2024 · 1 comment · Fixed by #646
Labels
bug Something isn't working databricks

Comments

@ShaneMazur
Copy link

Describe the bug
SparkSQL allows for numeric literals as described here. sqlfmt breaks sparkSQL code that uses this feature

To Reproduce

-- Unformatted

select -32y as col  -- indicates TINYINT, which is a 1-byte signed integer number
;
-- Formatted
select -32 y as col  -- errors out as the numeric literal must immediately follow the number
;

Expected behavior

Produce working formatted code with the same behaviour as the unformatted code

Actual behavior

Produces unusable sparkSQL code

Additional context
What is the output of sqlfmt --version?

sqlfmt, version 0.23.2

What is the output of pip list (or pipx list if you installed using pipx)?
pip_list.txt

@tconbeer tconbeer added the bug Something isn't working label Nov 12, 2024
@tconbeer
Copy link
Owner

Thanks for the issue and the link to the docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working databricks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants