Skip to content

Parse SQL Server 2025 / Fabric DW query syntax - #70

Merged
kyleconroy merged 1 commit into
claude/project-thread-4tipfffrom
claude/project-thread-4tipff-query
Dec 1, 2026
Merged

kyleconroy merged 1 commit into
claude/project-thread-4tipfffrom
claude/project-thread-4tipff-query

Conversation

@kyleconroy

Copy link
Copy Markdown
Collaborator

Requested by Kyle · project thread

Stacked on #69 (base: claude/project-thread-4tipff). Merge #69 first; this PR will then retarget to main.

Summary

Parses the new query-level syntax covered by tests added in #69:

  • ORDER BY ALL [ASC|DESC] → OrderByClause.All / AllSortOrder
  • TOP (n) WITH APPROXIMATE / WITH APPROX → TopRowFilter.WithApproximate
  • FETCH APPROXIMATE / APPROX, including without OFFSET → OffsetClause.WithApproximate
  • GROUP BY ALL with no grouping list (Fabric DW)
  • OPTION (FOR TIMESTAMP AS OF ...), FORCE SINGLE NODE PLAN, FORCE DISTRIBUTED PLAN
  • REDISTRIBUTE(n) join hint → QualifiedJoin.JoinHintColumnsCount
  • Nested CTEs (WITH inside a CTE body) → CommonTableExpression.WithCtesAndXmlNamespaces
  • Nested parentheses around a scalar before a comparison, e.g. ((IIF(...))) = 1

Enables 16 todo tests (OrderByAll, TopWithApproximate, FetchApproximate, ModernGroupByAll, QueryHints, FabricQueryHints, NestedCTE, IifParentheses and their baselines).

Test plan

  • go test ./...
  • go test ./parser/... -check-todo enabled the 16 tests

Generated by Claude Code

- ORDER BY ALL [ASC|DESC]
- TOP (n) WITH APPROXIMATE / WITH APPROX
- FETCH APPROXIMATE / APPROX, including without OFFSET
- GROUP BY ALL with no grouping list
- OPTION (FOR TIMESTAMP AS OF ...), FORCE SINGLE NODE PLAN, FORCE DISTRIBUTED PLAN
- REDISTRIBUTE(n) join hint column count
- Nested CTEs (WITH inside a CTE body)
- Nested parentheses around a scalar before a comparison: ((IIF(...))) = 1

Enables 16 todo tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4JQ53XPMqUY3Yc1vdv
@kyleconroy kyleconroy self-assigned this Dec 1, 2026
@kyleconroy
kyleconroy added this pull request to stack #73 December 1, 2026 06:14
@kyleconroy
kyleconroy merged commit f198e0c into main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants