DuckDB v2.0 replaces its SQL parser with a PEG-based one
DuckDB V2 PEG-based SQL parser
DuckDB v2.0 replaces its PostgreSQL-derived SQL parser with a PEG-based parser that is easier to evolve and can be extended at runtime. The new parser, first introduced experimentally in v1.5, now handles the complete DuckSQL dialect and produces the same AST as before. It also fixes exponential parsing times on malformed queries with packrat parsing, reducing a 10.6-second parse to 0.001 seconds.
Extending DuckSQL meant modifying the underlying YACC/Bison grammar.