Skip to content

DruidSQL should allow (and trim out) trailing semicolons; #11212

Open
@vogievetsky

Description

@vogievetsky

Description

It is pretty standard to finish queries with semicolons, right now this fails to parse in Druid. It would be really easy to trim out the trailing semicolons and ignore them just like comments are ignored

Motivation

It would improve the query UX just a little bit.

Right now

curl 'http://localhost:8888/druid/v2/sql' -H 'Content-Type: application/json' --data-raw '{"query":"SELECT isNew, COUNT(*) FROM wikipedia GROUP BY 1 ORDER BY 2 DESC;"}'

Fails with

{"error":"SQL parse failed","errorMessage":"Encountered \";\" at line 1, column 65.\nWas expecting one of:\n <EOF> \n \"FETCH\" ...\n \"LIMIT\" ...\n \"NULLS\" ...\n \"OFFSET\" ...\n \",\" ...\n ","errorClass":"org.apache.calcite.sql.parser.SqlParseException","host":null}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions