Open esobolievv opened 2 weeks ago
HI @nedtwigg thank you for marking as the BUG. I added "UPD" section and described that it's impossible for me to use Spotless SQL formatter anymore within Spark SQL syntax as I can't control how formatter puts a whitespace. It breaks SQL easily that is hard to track. Are there any possible workarounds?
If you are submitting a bug, please include the following:
Hi Team,
We have a big side-effect of using DBeaver SQL formatter within spotless "as is".
When I run this formatter on valid Spark SQL code where column name is wrapped with backtick symbol, it puts whitespaces around column name making .sql valid INVALID for spark to run within
spark.sql("sql-query-from-file")
It's easy to reproduce. Just create a simple SQL file within columns given below with backticks (see: Expected example) and you'll see it's formatter to "Current behavior" that is not valid syntax.
Versions:
.dbeaver.properties
Current behavior (formatter gives not valid spark sql):
Expected (valid spark sql):
UPD: Other problems with whitespace were discovered that makes it IMPOSSIBLE to use Spotless anymore :(
3p_dummy
->3 p_dummy
arr[0]
->arr [ 0 ]
0L as dummy
->0 L as dummy
It seem like so popular Spark SQL syntax isn't supported here. Would appreciate it addressing asap or propose a possible workaround
gradlew spotless[Apply/Check] --stacktrace
If you're just submitting a feature request or question, no need for the above.