GlareDB / glaredb_next

5 stars 1 forks source link

Allow trailing comma in FROM clause #242

Open scsmithr opened 2 months ago

scsmithr commented 2 months ago

eg

    SELECT
        l_suppkey AS supplier_no,
        sum(l_extendedprice * (1 - l_discount)) AS total_revenue
    FROM
        '../submodules/testdata/tpch_sf0.1/lineitem.parquet'  lineitem,
    WHERE
        l_shipdate >= CAST('1996-01-01' AS date)
      AND l_shipdate < CAST('1996-04-01' AS date)
    GROUP BY
        supplier_no

Current errors with

Expected RightParen, got Some(TokenWithLocation { token: GtEq, line: 0, col: 0 })

tychoish commented 2 months ago

what about other clauses which might have trailing commas (select, where, etc.) ?

scsmithr commented 2 months ago

Trailing comma in select already works. Commas in where wouldn't be valid. Order by/ group by could allow trailing commas too.

tychoish commented 2 months ago

should add group by at the same time if we get there.