Skip to content

fix(datafusion): reject writes to shadowed persistent tables - #1373

Open
slfan1989 wants to merge 2 commits into
apache:mainfrom
slfan1989:paimon-rust-1372
Open

slfan1989 wants to merge 2 commits into
apache:mainfrom
slfan1989:paimon-rust-1372

Conversation

@slfan1989

@slfan1989 slfan1989 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #1372

Prevent SQL commands from modifying a persistent Paimon table when a temporary table or view shadows it.

Brief change log

  • Check for temporary targets before executing ALTER TABLE, including ADD PARTITION, DROP PARTITION, and schema changes.
  • Apply the same check to INSERT OVERWRITE ... PARTITION, MSCK REPAIR TABLE, and ANALYZE TABLE.

Tests

  • Verify that rejected commands preserve persistent rows, partition registrations, and statistics.
  • Verify that partition overwrite and drop still work after the temporary object is removed.

API and Format

No.

Documentation

No.

@QuakeWang QuakeWang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any other rejection points? Could we address them all in a single PR?

@slfan1989

Copy link
Copy Markdown
Contributor Author

Do you have any other rejection points? Could we address them all in a single PR?

Thanks for the suggestion, @JingsongLi @QuakeWang ! I’ve extended the fix to cover ALTER TABLE, INSERT OVERWRITE ... PARTITION, MSCK REPAIR TABLE, and ANALYZE TABLE together. The regression tests verify that these commands reject shadowed targets before modifying the persistent table’s data, partition registrations, or statistics.

@slfan1989 slfan1989 changed the title fix(datafusion): reject DROP PARTITION on temporary targets fix(datafusion): reject writes to shadowed persistent tables Nov 11, 2026
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.

[Bug] SQL commands can modify persistent tables shadowed by temporary objects

3 participants