Skip to content

Generic, SQLite: parse WITH ... AS [NOT] MATERIALIZED - #2708

Open
princejain756 wants to merge 1 commit into
apache:mainfrom
princejain756:generic-sqlite-cte-materialized
Open

princejain756 wants to merge 1 commit into
apache:mainfrom
princejain756:generic-sqlite-cte-materialized

Conversation

@princejain756

Copy link
Copy Markdown

WITH c AS MATERIALIZED (SELECT 1) was rejected by GenericDialect (the DataFusion default) and SQLiteDialect; only PostgreSQL and DuckDB enabled supports_cte_materialization().

Both engines support the directive: SQLite since 3.35 (docs, verified against sqlite3), and Generic covers the DataFusion use case described in the issue. MATERIALIZED directly after AS is not ambiguous with other syntax.

Refs #2622

AI assistance: this change was implemented with help from an AI coding agent; the behavior and tests were verified manually.

supports_cte_materialization() covered PostgreSQL and DuckDB only, so
the generic dialect (the DataFusion default) and SQLite rejected the
directive even though SQLite accepts it and DataFusion supports it
through the generic dialect.

Refs apache#2622
@princejain756
princejain756 force-pushed the generic-sqlite-cte-materialized branch from de28b20 to d65c76d Compare October 21, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant