Skip to content

[BUG] JSQLParser 5.3 : Snowflake : Encountered unexpected token: "sample" <S_IDENTIFIER> Was expecting one of: "AS" #2417

@apptio-speravali

Description

@apptio-speravali

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

  • Sql parse is failing when a $ in a SQL statement is enclosed in $$

SQL Example:

  • Simplified Query Example, focusing on the failing feature
    select CAST($$Spend sample failure $10$$ AS STRING)

Software Information:

  • JSqlParser version : 5.3
  • Database (Snowflake)

Link:

Please write in English and avoid Screenshots (as we can't copy and paste content from it).
The Sql parse failed as it contains $10 removing the $ fixed the issue.
http://jsqlformatter.manticore-projects.com/jsqlformatter/demo.html?args=-c%20M4UwNiDGAuAEDCBBAygFQBQBJMDMCGAlmAK4BOIs0IwcwADiAHYAmsmAjAAzawqxoAlAJIA5AOIBKANxA$$$
Do provide Links or References to the specific Grammar and Syntax you are trying to use.
Snowflake supports $$...$$ syntax , so I am trying to use select CAST($$test sample failure $10$$ AS STRING)

Error

 Encountered unexpected token: "sample" <S_IDENTIFIER> Was expecting one of: "AS"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions