Skip to content

Snowflake AT(time travel) parsing error #6070

@twice154

Description

@twice154

Search before asking

  • I searched the issues and found no similar issues.

What Happened

If I use Snowflake AT(time travel) in query and run sqlfluff lint, parsing error happens.

Expected Behaviour

No parsing error happens because it's official function of Snowflake.

Observed Behaviour

L:  16 | P:  12 |  PRS | Line 16, Position 12: Found unparsable section:
                       | "(TIMESTAMP => TO_TIMESTAMP(DATEADD('DAY'..."

How to reproduce

Using Snowflake's time travel query like below.
AT (TIMESTAMP => TO_TIMESTAMP(DATEADD('DAY', -1, DATEADD('MONTH', -1, DATEADD('DAY', -1, CURRENT_DATE)))))

Dialect

Snowflake

Version

3.1.0

Configuration

[sqlfluff]
dialect = snowflake
templater = jinja
exclude_rules = ambiguous, structure, references, aliasing, layout, capitalisation

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 workingsnowflakeIssues related to the Snowflake dialect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions