We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug In some dialects (eg databricks) we can define query hints. These are defined as comments in the format /*+ some_hint */.
/*+ some_hint */
sqlfmt formats these comments as /* + some_hint */ (notice the extra space) which is invalid, causing the hint to be ignored on runtime.
/* + some_hint */
To Reproduce Example run from command line: echo "select /*+ some_hint */ * from table" | sqlfmt -
echo "select /*+ some_hint */ * from table" | sqlfmt -
Expected behavior The query hint should remain the same:
select /*+ some_hint */ * from table
Actual behavior This is what sqlfmt gives:
select /* + some_hint */ * from table
I think the easiest solution would be to detect the "+" and ignore these comments when formatting.
Additional context What is the output of sqlfmt --version? sqlfmt, version 0.23.2
sqlfmt --version
sqlfmt, version 0.23.2
The text was updated successfully, but these errors were encountered:
fix/#639/support databricks query hints (#647)
dca12e6
* fix: support databricks type hint comments * chore: update changelog * fix: add unit test for coverage
Successfully merging a pull request may close this issue.
Describe the bug
In some dialects (eg databricks) we can define query hints. These are defined as comments in the format
/*+ some_hint */
.sqlfmt formats these comments as
/* + some_hint */
(notice the extra space) which is invalid, causing the hint to be ignored on runtime.To Reproduce
Example run from command line:
echo "select /*+ some_hint */ * from table" | sqlfmt -
Expected behavior
The query hint should remain the same:
Actual behavior
This is what sqlfmt gives:
I think the easiest solution would be to detect the "+" and ignore these comments when formatting.
Additional context
What is the output of
sqlfmt --version
?sqlfmt, version 0.23.2
The text was updated successfully, but these errors were encountered: