Skip to content

fix(isthmus): preserve CTAS creation policies - #1266

Draft
bvolpato wants to merge 1 commit into
substrait-io:mainfrom
bvolpato:bvolpato/fix-ctas-create-mode
Draft

fix(isthmus): preserve CTAS creation policies#1266
bvolpato wants to merge 1 commit into
substrait-io:mainfrom
bvolpato:bvolpato/fix-ctas-create-mode

Conversation

@bvolpato

@bvolpato bvolpato commented Sep 3, 2026

Copy link
Copy Markdown
Member

Plain CREATE TABLE AS SELECT and CREATE TABLE IF NOT EXISTS currently emit REPLACE_IF_EXISTS, allowing a consumer to replace an existing table when the SQL requests an error or a no-op.

Carry ERROR_IF_EXISTS, IGNORE_IF_EXISTS, and REPLACE_IF_EXISTS from the SQL flags through CreateTable, planner copies, and both conversion directions. Include the mode in planner digests so different creation policies remain distinct. Explicit replacement requires CREATE OR REPLACE TABLE; existing programmatic constructors retain their historical replacement behavior.

These policies map to the CTAS creation modes defined by Substrait v0.102.0. Conflicting SQL flags are rejected.

Plain CREATE TABLE AS SELECT and CREATE TABLE IF NOT EXISTS currently emit REPLACE_IF_EXISTS, allowing a consumer to replace an existing table when the SQL requests an error or a no-op.

Carry ERROR_IF_EXISTS, IGNORE_IF_EXISTS, and REPLACE_IF_EXISTS from the SQL flags through CreateTable, planner copies, and both conversion directions. Include the mode in planner digests so different creation policies remain distinct. Explicit replacement requires CREATE OR REPLACE TABLE; existing programmatic constructors retain their historical replacement behavior.

These policies map to the CTAS creation modes defined by Substrait v0.102.0. Conflicting SQL flags are rejected.
@bvolpato
bvolpato force-pushed the bvolpato/fix-ctas-create-mode branch from 7af5f67 to 7aa6240 Compare September 4, 2026 16:27
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.

1 participant