taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL
https://taozhi8833998.github.io/node-sql-parser/
Apache License 2.0
823 stars 184 forks source link

Snowflake - a query couldn't be parsed with the 'mode' function #2101

Closed LaizaAngrest closed 2 months ago

LaizaAngrest commented 2 months ago

Describe the bug A query couldn't be parsed with the 'mode' function

Database Engine Snowflake

To Reproduce

it('Should parse query with mode', function () {
    const parser = new SqlParser(WarehouseType.Snowflake)
    const query = `
    select
    mode(name) OVER (
      partition by
        id
    ) most_frequent_name
    from airbnb.staging_test1_montara1_com.raw_hosts h`
    const parsedSql = parser.parse(query)
    expect(parsedSql).toBeDefined()
  })