Skip to content

fix: resolve all synq_clickhouse and synq_postgres corpus failures#54

Merged
lustefaniak merged 4 commits intomainfrom
lukasz-synq-corpus-fixes
Mar 6, 2026
Merged

fix: resolve all synq_clickhouse and synq_postgres corpus failures#54
lustefaniak merged 4 commits intomainfrom
lukasz-synq-corpus-fixes

Conversation

@lustefaniak
Copy link
Collaborator

Summary

  • Fixes all 52 corpus failures in synq_clickhouse (39) and synq_postgres (13) categories
  • No regressions — all existing tests pass, overall corpus improved from 894 to 840 failures

ClickHouse additions

  • ALTER TABLE ... MODIFY COLUMN (with optional data type and REMOVE DEFAULT)
  • ALTER TABLE ... MATERIALIZE COLUMN/PROJECTION
  • ALTER TABLE ... DROP INDEX [IF EXISTS]
  • ALTER TABLE ... UPDATE ... WHERE (lightweight mutations)
  • EXCHANGE TABLES t1 AND t2 statement
  • CREATE TABLE t1 AS t2 ENGINE = ... syntax
  • ADD PROJECTION IF NOT EXISTS (IF NOT EXISTS after PROJECTION keyword)

PostgreSQL additions

  • DO $$ ... $$ anonymous code blocks
  • ALTER TABLE ... UPDATE (ClickHouse syntax tolerance)
  • jsonb ? (has key) binary operator
  • FOREIGN KEY REFERENCES without column list in table constraints
  • DROP COLUMN / ADD COLUMN tolerance for missing identifiers/types

Keywords added

EXCHANGE, MATERIALIZE, MODIFY, REMOVE

…PROJECTION IF NOT EXISTS

Also fixes:
- MODIFY COLUMN without data type (REMOVE DEFAULT only)
- ALTER TABLE UPDATE for PostgreSQL dialect
- FOREIGN KEY REFERENCES without column list in table constraints
…ADD COLUMN without type

Also fixes:
- ADD IF NOT EXISTS PARTITION regression from previous commit
- PostgreSQL DO $$ ... $$ anonymous code blocks
- DROP COLUMN with missing column name (broken SQL tolerance)
- Column definition without data type (Unspecified fallback)
- PostgreSQL jsonb ? (has key) binary operator
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Corpus Parsing Report

Total: 104246 passed, 840 failed (99.2% pass rate)

Changes

2 improvement(s) (now passing)
2106 new test(s)

By Dialect

Dialect Passed Failed Total Pass Rate Delta
ansi 583 129 712 81.9% +2
bigquery 35193 86 35279 99.8% -
clickhouse 3908 93 4001 97.7% +793
databricks 1361 31 1392 97.8% -
duckdb 712 63 775 91.9% -
hive 32 29 61 52.5% -
mysql 150 69 219 68.5% -
postgres 1502 66 1568 95.8% +1313
redshift 13449 59 13508 99.6% -
snowflake 47232 195 47427 99.6% -
sqlite 44 16 60 73.3% -
trino 80 4 84 95.2% -
✅ Improvements (2)
sqlglot_ansi/alter/1e12975cc239.sql
sqlglot_ansi/alter/912d29d69810.sql
➕ New Tests (2106)
synq_clickhouse/_blocks/001156589b0b.sql
synq_clickhouse/_blocks/017d8ea38806.sql
synq_clickhouse/_blocks/01b9e98a1db7.sql
synq_clickhouse/_blocks/01dea59ad2e1.sql
synq_clickhouse/_blocks/02c50a9e9614.sql
synq_clickhouse/_blocks/03aece7136f9.sql
synq_clickhouse/_blocks/047521f9ff79.sql
synq_clickhouse/_blocks/05ee5cb42acb.sql
synq_clickhouse/_blocks/065e66bb6f9e.sql
synq_clickhouse/_blocks/09c754a80936.sql
... and 2096 more

@lustefaniak lustefaniak merged commit 215273d into main Mar 6, 2026
3 checks passed
@lustefaniak lustefaniak deleted the lukasz-synq-corpus-fixes branch March 6, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant