Skip to content

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-07-30 — GSP Java 4.1.9, sqlglot 30.2.1, JSQLParser 5.1, all over the same corpus (GSP's documented-example corpus, commit 00d9d096b).

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 Command node 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.1.9 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 359 of 455 (79%) 220 of 455 (48%) / 424 (93%) 230 of 455 (51%) JSON
SQL Server (T-SQL) 290 210 of 290 (72%) 30 of 290 (10%) / 252 (87%) 115 of 290 (40%) 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: 68 constructs (ALTER API INTEGRATION, ALTER DATABASE, ALTER DATABASE, ALTER EXTERNAL FUNCTION, ALTER EXTERNAL FUNCTION, ALTER EXTERNAL FUNCTION, ALTER EXTERNAL TABLE, ALTER EXTERNAL TABLE — and 60 more)
  • SQL Server (T-SQL): 33 constructs (ALTER AVAILABILITY GROUP, ALTER BROKER PRIORITY, ALTER COLUMN ENCRYPTION KEY, ALTER CRYPTOGRAPHIC PROVIDER, ALTER EVENT SESSION, ALTER EXTERNAL DATA SOURCE, ALTER EXTERNAL LANGUAGE, ALTER EXTERNAL LIBRARY — and 25 more)