GSP vs sqlglot vs JSQLParser — measured¶
The same corpus, three parsers, whole-file pass/fail, every result published. Regenerated with each GSP release.
Measured head-to-head parse results¶
Measured on 2026-09-28 — GSP Java 4.2.13, sqlglot 30.2.1, JSQLParser 5.1, all over the same corpus (GSP's documented-example corpus, commit d9f2e0a51).
Methodology — read before citing
- Unit: one whole corpus file = the complete set of examples from the vendor's documentation for one SQL construct. A tool passes iff it parses the entire file without error. No tool's statement splitter is trusted over another's.
- Dialect modes: sqlglot runs with its matching dialect (
postgres,snowflake,tsql). JSQLParser has no dialect modes; its single grammar is used as-is — that is how a user would have to run it. - sqlglot gets two numbers. sqlglot does not raise on syntax it cannot parse — it wraps it in an opaque
Commandnode and logs "Falling back to parsing as a 'Command'". Strict counts only files parsed into a structured AST; lenient also counts Command-fallback acceptances (no structure returned, but no error either). Choose whichever matches your use case: for lineage, validation, or rewriting you need the strict number. - The corpus is GSP's own test corpus. It was built to exercise GSP against vendor documentation, not to flatter competitors — but the same bias risk applies to any vendor-published benchmark. Every per-file result (including every GSP failure) is published in the JSON downloads so anyone can re-run and audit: the harness is in the GSP repository at
sqlcoverage/compare/. - Timeouts (15s per file) count as failures.
| Dialect | Corpus files | GSP 4.2.13 | sqlglot 30.2.1 (strict / lenient) | JSQLParser 5.1 | Data |
|---|---|---|---|---|---|
| PostgreSQL | 132 | 127 of 132 (96%) | 22 of 132 (17%) / 110 (83%) | 54 of 132 (41%) | JSON |
| Snowflake | 455 | 455 of 455 (100%) | 223 of 455 (49%) / 427 (94%) | 232 of 455 (51%) | JSON |
| SQL Server (T-SQL) | 290 | 290 of 290 (100%) | 30 of 290 (10%) / 252 (87%) | 114 of 290 (39%) | JSON |
Where the others win¶
Constructs that GSP fails but at least one other tool parses (full lists in the JSON):
- PostgreSQL: none — no construct in this corpus parses elsewhere but not in GSP
- Snowflake: none — no construct in this corpus parses elsewhere but not in GSP
- SQL Server (T-SQL): none — no construct in this corpus parses elsewhere but not in GSP