• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AfterShip / clickhouse-sql-parser / 30455578247

29 Jul 2026 01:20PM UTC coverage: 54.471% (+0.2%) from 54.268%
30455578247

Pull #290

github

therealpandey
Support SQL-standard keyword arguments for trim, substring and overlay (#289)

ClickHouse accepts `trim(BOTH ' ' FROM s)`, `substring(s FROM 2 FOR 3)` and
`overlay(s PLACING r FROM 2 FOR 3)`, but the parser only split arguments on
commas, so it rejected all of them.

Recognise the keyword form from a per-function table listing the leading
modifiers, the separator keywords in order, and how many are mandatory. The
form is decided after the first argument, as parseColumnExtractExpr already
does for EXTRACT, so comma arguments and `both`/`placing`/`overlay` as column
names keep working.

Each separator becomes a BinaryOperation and the trim modifier a UnaryExpr, so
no new AST node is needed and traversal and formatting are unchanged.

Grammar verified against ClickHouse 26.8.1.337 in both directions: the forms it
rejects — a missing trim modifier, a missing FROM, out-of-order separators, and
substringUTF8, which has no keyword form unlike overlayUTF8 — stay rejected.
Pull Request #290: Support SQL-standard keyword arguments for trim, substring and overlay

9015 of 16550 relevant lines covered (54.47%)

3061.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.01
/parser/parser_column.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc