Describe the bug
Invalid query with generator(rowcount => in Snowflake
Database Engine
Snowflake
To Reproduce
it('should parse a query with generator(rowcount =>', function () {
const parser = new SqlParserV2()
const query = `
select *, date(concat(left(date,7),'-01')) as date_start_month, left(date,7) as month from
((select
dateadd(day, '-' || seq4(), current_date()) as date
from
table(generator(rowcount => 1095))
where date>='2022-10-01') as dates
left join
(select id, name, category, start_date, end_date, days, cost, cost/days as cost_per_day
from
(select id, name, category, start_date, end_date, cost, datediff('day',start_date, end_date)+1 as days
from ui_other_costs
group by 1,2,3,4,5,6)
group by 1,2,3,4,5,6,7) as cost)
where dates.date between cost.start_date and cost.end_date`
const parsedSql = parser.parse(query, WarehouseType.Snowflake)
expect(parsedSql).toBeDefined()
})
Describe the bug Invalid query with generator(rowcount => in Snowflake
Database Engine Snowflake
To Reproduce
Expected behavior Valid query