-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
Snowflake, Postgres: Parse failure on concatention operator ||
#4164
Comments
||
for no real reason||
"For no real reason"? |
I meant it fails when it should not (on a valid syntax). Didn't mean to offend or being rude. :D Coming from my initial assumption that SQLs I've been linting were broken. :D |
The bug is reproducable in v1.4.3; v1.4.2 is unaffected. |
I am experiencing this as well. The double pipe concatenation operator is being split into two and is causing the query to fail during execution. |
Experiencing this as well in BigQuery. Looks like |
Just go this too. Submitting a fix. |
FYI adding this to your config fixes it:
We're adding it to the default config in #4168 and releasing another fix tonight, but if you can't wait then apply above addition to your config. |
SQLFluff 1.4.4 has been released with this fixed in it. Apologies! |
@tunetheweb thank you! |
Search before asking
What Happened
Concatenate operand
||
incorrectly parsed as two pipes. Both Snowflake and Postgres recognize||
as concatenation operand, thus'a' || 'b' -- => 'ab'
. SQLFluff blames it's incorrect syntax.Expected Behaviour
'a' || 'b'
should pass lintingObserved Behaviour
'a' || 'b'
fails linting with:How to reproduce
echo "SELECT 'a' || 'b' AS c;" | sqlfluff lint --dialect postgres --disable-progress-bar -
echo "SELECT 'a' || 'b' AS c;" | sqlfluff lint --dialect snowflake --disable-progress-bar -
Dialect
Snowflake
Postgres
Version
sqlfluff, version 1.4.3
Python 3.10.9
Configuration
[sqlfluff]
templater = jinja
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
The text was updated successfully, but these errors were encountered: