flux-pr-1628
sqlparser-rs (Rust) · W2 · GPT-5.3 Codex
Tests passed. 1/1 commands passed. Strength: strong.
env PATH=/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin cargo test --all-featuresPartial score: 1/1
Trajectory
codex · partial order onlyprovider-native trajectory captured; validation and decision steps are appended with coarse ordering only
Quality
Equivalence Reasoning
behavioral
The patch only adds `FORMAT <identifier|NULL>` handling (reusing `FormatClause`) and does not parse/round-trip ClickHouse input payload after `FORMAT` (e.g., `FORMAT JSONEachRow {...}` / CSV rows), which is a core part of the requested INSERT extension. It also lacks the gold behavior that treats INSERT `FORMAT` as a distinct input-format clause with optional values/expressions, so intended ClickHouse INSERT syntax support is incomplete.
Code Review
The patch is directionally close but likely does not satisfy the intended ClickHouse INSERT FORMAT support: it misses parsing of FORMAT payload values and can emit incorrect `DEFAULT VALUES FORMAT ...` SQL during display/round-trip.
In `Display for Insert`, `DEFAULT VALUES` is emitted when `source.is_none() && columns.is_empty()` before appending `format_clause`. For FORMAT-only INSERTs this generates invalid output and breaks round-trip fidelity.
The parser only accepts `FORMAT NULL` or `FORMAT <identifier>` and the AST stores `Option<FormatClause>`, so ClickHouse forms like `FORMAT JSONEachRow {...}` are not represented/consumed, leaving required payload unsupported.
The new INSERT path always tries `parse_settings()` and `parse_format_clause()` in non-SET branch, and `parse_format_clause` is enabled for `ClickHouseDialect | GenericDialect`, which widens behavior beyond the intended ClickHouse-specific extension.