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

Sleek breaks scientific notation #72

Open
BenQuigley opened this issue Jul 18, 2024 · 1 comment
Open

Sleek breaks scientific notation #72

BenQuigley opened this issue Jul 18, 2024 · 1 comment

Comments

@BenQuigley
Copy link

I've been using this and it's a great SQL formatter, working better for my particular use case than several others I have tried. However, I noticed today that numbers in scientific notation aren't supported. Consider the file example.sql:

SELECT
    1.3e6 AS thirteen_hundred_thousand

That's valid in presto sql / amazon athena, at least; it evaluates to a double 130000.0. However, sleek 0.3.0 (called with no args) breaks this example script, reformatting it to:

SELECT
    1.3 e6 AS thirteen_hundred_thousand

which then errors out in Athena, returning line 2:12: mismatched input 'AS'. Expecting: ',', 'EXCEPT', 'FETCH', 'FROM', 'GROUP', 'HAVING', 'INTERSECT', 'LIMIT', 'OFFSET', 'ORDER', 'UNION', 'WHERE', 'WINDOW', <EOF>.

Is this an issue for sqlformat?

@slashformotion
Copy link

all formating is handled by the crate sql-format, I would suggest opening the issue there

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