-
Notifications
You must be signed in to change notification settings - Fork 7
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
Table Options formatted like Field option #22
Comments
It seems that you are not using Because when I attempt to format this code I get a parse error. Mainly because of the I suspect you're instead using either sql-formatter or prettier-plugin-sql (which uses I can only say that fixing the |
Anyway, I'm closing this issue as it doesn't directly apply to Thanks for reminding me about new syntax in BigQuery. I've opened a separate issue to fix that: nene/sql-parser-cst#69 As you are using BigQuery, I do encourage you to give a try to this plugin though as BigQuery is one of the dialects that has the best support. For example it does format the above |
BTW, @dang1507 is the Also, the syntax you used for PARTITION BY
MYNUMBER RANGE_BUCKET(0, 100000) Is this actually supported by BigQuery? It doesn't look like valid syntax to me. |
Nice catches. I was typing these out on the fly and didn't check the
details. Mostly I was throwing out stuff I work with regularly and wanted
to see how the various plugin formatters worked.
I want one based on prettier but with a few extra options.
Thank you for calling these out.
Corrected
Create...(
MYNUMBER INT64 NOT NULL OPTIONS(...),
My_total Decimal(10, 2) default 0.0 options(...)
)
PARTITION BY
RANGE_BUCKET(MYNUMBER, GENERATE_ARRAY(0, 100, 1))
Daniel
…On Mon, Feb 5, 2024, 11:46 Rene Saarsoo ***@***.***> wrote:
BTW, @dang1507 <https://github.com/dang1507> is the DOUBLE data type
actually supported by BigQuery? I don't see it mentioned in the
documentation
<https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#numeric_types>.
I think you intended to use DECIMAL as DOUBLE (10, 2) doesn't really make
sense to me.
Also, the syntax you used for PARTITION BY:
PARTITION BY
MYNUMBER RANGE_BUCKET(0, 100000)
Is this actually supported by BigQuery? It doesn't look like valid syntax
to me.
—
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOL4NHGSGZJAK4FY3AN65V3YSEEIDAVCNFSM6AAAAABCYS5FYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRXGQ2DEOBXGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks. |
I found an oddity in the formatting when using BIGQUERY syntax. When creating tables with metadata, the PARTITION BY and CLUSTER BY come before the OPTIONS(<TABLE OPTIONS>). The formatter does not add a new line as it should because this syntax mirrors field options.
Actual
Corrected
The text was updated successfully, but these errors were encountered: