Skip to content

Fails to parse ?& array['foo'] #6321

@jpmckinney

Description

@jpmckinney

Search before asking

  • I searched the issues and found no similar issues.

What Happened

Write test.sql:

SELECT '["a", "b", "c"]'::jsonb ?& array['a', 'b'];

Run:

$ sqlfluff lint
== [test.sql] FAIL                                                                                                                                                                                                 
L:   1 | P:  33 |  PRS | Line 1, Position 33: Found unparsable section: "?&
                       | array['a', 'b']"
WARNING: Parsing errors found and dialect is set to 'postgres'. Have you configured your dialect correctly?
All Finished 📜 🎉!

Expected Behaviour

It parses this JSON expression, taken from https://www.postgresql.org/docs/current/functions-json.html

Observed Behaviour

See What Happened

How to reproduce

See What Happened

Dialect

postgres

Version

sqlfluff, version 3.2.2

Configuration

[tool.sqlfluff.core]
dialect = "postgres"

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions