Repository navigation
feat(parser): parse PIVOT DEFAULT ON NULL, ClickHouse FINAL/SAMPLE, INSERT TOP, MySQL partition actions, ROWS FROM, array subscripts, nested GROUPING SETS - #873
Conversation
…NSERT TOP, MySQL partition actions, ROWS FROM, array subscripts, nested GROUPING SETS - Snowflake PIVOT ... DEFAULT ON NULL (expr) and IN (ANY [ORDER BY ...]). - ClickHouse FINAL and SAMPLE n [OFFSET m] on FROM and joined tables. - SQL Server INSERT TOP (n) [PERCENT] [INTO]. - PostgreSQL identity columns combined with other constraints; DEFAULT, identity and generation expressions are mutually exclusive. - MySQL/MariaDB ALTER TABLE PARTITION BY / ADD / DROP / TRUNCATE / REORGANIZE / COALESCE / EXCHANGE / ANALYZE / CHECK / OPTIMIZE / REBUILD / REPAIR / DISCARD / IMPORT PARTITION, REMOVE / UPGRADE PARTITIONING; forms outside the structured grammar keep the as-written fallback. - PostgreSQL ROWS FROM (...) [WITH ORDINALITY], subscripts and slices after ARRAY[...], and GROUPING SETS nested with ROLLUP, CUBE, () and GROUPING SETS. - Signed numbers stay attached in type and identity options (INCREMENT -1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Claude finished @ajitpratap0's task in 41s —— View job Review of PR #873I read the core parser and AST changes. I did not run the test suite. The PR description lists race, cbinding, lint and corpus runs as green. Overall: The change is well structured. The new parse paths are dialect-gated, and recursion in nested Notes
VerdictNo blocking issues found. The items above are small improvements and a few questions. I'd merge once the CHANGELOG mentions the DEFAULT/identity rejection. |
Lower-case formatting renders GROUPING SETS itself so a lone ROLLUP, CUBE or GROUPING SETS element stays unparenthesised (a slot hid its type from SQL()); the round-trip test folds the case of unquoted function names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2
|
Claude finished @ajitpratap0's task in 24s —— View job Review of PR #873I read the diff for the parser, AST pooling, Overall: The change is solid. The new parse paths are dialect-gated, and the new AST nodes are covered by round-trip, reachability and release tests. I found no blocking issues. Notes
VerdictI would merge this. The items above are optional follow-ups. |
|
Claude finished @ajitpratap0's task in 14s —— View job Review of PR #873I read the diff for Overall: I found no blocking issues. The change is well scoped, the new paths are dialect-gated, and the tests cover round-trip, reachability and release. Notes
VerdictI would merge this. The items above are optional follow-ups. |
Summary
Constructs that failed to parse in the post-merge audit of #866–#868. Each now parses, renders through
SQL()and the formatter, is reachable fromChildren(), is released by the pools, and round-trips.PIVOT (… FOR c IN (ANY ORDER BY c) DEFAULT ON NULL (0))FROM t [AS x] FINAL SAMPLE 0.1 [OFFSET 1/2], on the first table and on joined tables. SAMPLE accepts decimal numbers and fractions only.INSERT TOP (n) [PERCENT] [INTO] t …ALTER TABLEpartition actions:PARTITION BY, ADD (includingIF NOT EXISTS,PARTITIONS n, MariaDB HISTORY/CURRENT), DROP/TRUNCATE (names,ALL,IF EXISTS), REORGANIZE, COALESCE, EXCHANGE … WITH TABLE [WITH|WITHOUT VALIDATION], ANALYZE/CHECK/OPTIMIZE/REBUILD/REPAIR, DISCARD/IMPORT TABLESPACE, REMOVE/UPGRADE PARTITIONING. Forms the structured grammar doesn't cover fall back to the as-written parse, as on main.ROWS FROM (f(), g()) [WITH ORDINALITY] AS r(…),ARRAY[…][i], slices, andGROUPING SETS ((a), ROLLUP(b), CUBE(a,b), (), GROUPING SETS (…))INCREMENT -1, ClickHouseEnum8('b' = -2).Test Plan
gofmt,go vet,golangci-lint run(0 issues),task test:race,task test:cbinding;TestRealWorldCorpusgreen with new90_review_gaps.sqlstatements for 6 dialectsfinal,sample,rowsstill work as aliases)Breaking Changes
SAMPLEwith a non-decimal size (e.g. hex) is rejected.SQL()now writes SAMPLE before ClickHouseARRAY JOIN, where ClickHouse expects it.🤖 Generated with Claude Code
https://claude.ai/code/session_01DnbRnTFErhoMJdAjVEeCg2