Repository navigation
fix(isthmus)!: preserve CTAS creation policies - #1266
Conversation
7af5f67 to
7aa6240
Compare
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.
7aa6240 to
d6b8d7e
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nielspardon
left a comment
There was a problem hiding this comment.
Please mark this fix(isthmus)!: and end the body with a BREAKING CHANGE: footer: the same SQL now produces different plans (plain CTAS → ERROR_IF_EXISTS), released isthmus can't read those plans, and CREATE OR REPLACE TABLE IF NOT EXISTS now throws. The mapping itself matches the spec. Small nit for the body: CreateMode has been in the spec since v0.60.0, not v0.102.0.
|
Thanks for the review. I also prepared the breaking-change title and final footer, including the old-reader compatibility impact, and clarified that these CTAS modes have been defined since v0.60.0. The code and test follow-ups above pass the full local build. The branch and description updates have not been published yet. |
Reject unsupported creation policies at construction, deprecate implicit replacement constructors, and keep explain output JSON-compatible. Report conflicting SQL flags as input errors and validate empty-catalog round trips.
|
I pushed the constructor validation, deprecated the implicit-mode constructors, and fixed JSON explain output and CLI error handling. The consolidated round-trip tests include an empty catalog, and the breaking-change note now spells out the compatibility impact. |
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. These CTAS creation modes have been defined since Substrait v0.60.0. Isthmus rejects other creation modes consistently and rejects conflicting SQL flags rather than choosing a precedence that the specification does not define.
Explicit replacement requires CREATE OR REPLACE TABLE. Existing programmatic constructors retain their historical replacement behavior but are deprecated in favor of the constructor with an explicit creation mode.
BREAKING CHANGE: Plain CREATE TABLE AS SELECT now emits ERROR_IF_EXISTS and CREATE TABLE IF NOT EXISTS emits IGNORE_IF_EXISTS instead of REPLACE_IF_EXISTS. Older Isthmus readers that accept only replacement-mode CTAS cannot read these plans. CREATE OR REPLACE TABLE IF NOT EXISTS is now rejected. Callers requiring replacement must request it explicitly.