DruidSQL should allow (and trim out) trailing semicolons;
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
### 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 \n \"FETCH\" ...\n \"LIMIT\" ...\n \"NULLS\" ...\n \"OFFSET\" ...\n \",\" ...\n ","errorClass":"org.apache.calcite.sql.parser.SqlParseException","host":null}`
Contributor guide
Research direction
Start at the Druid SQL endpoint shown in the curl example and trace how the query reaches the Apache Calcite parser. Add coverage for a query ending in a semicolon, and consider the work done when that request parses and executes without the trailing semicolon affecting the query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100