Skip to content

[KYUUBI #7369] KSHC support the PURGE TABLE#7370

Closed
maomaodev wants to merge 7 commits intoapache:masterfrom
maomaodev:kyuubi-7369
Closed

[KYUUBI #7369] KSHC support the PURGE TABLE#7370
maomaodev wants to merge 7 commits intoapache:masterfrom
maomaodev:kyuubi-7369

Conversation

@maomaodev
Copy link
Copy Markdown
Contributor

@maomaodev maomaodev commented Mar 27, 2026

Why are the changes needed?

  1. Support DROP TABLE ... PURGE syntax in KSHC, so users can explicitly purge table data.
  2. Add a compatibility configuration spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable (default: false) in KSHC. When set to true, DROP TABLE behaves like PURGE— data is removed immediately and HDFS Trash is bypassed (preserving the previous behavior). When set to false, DROP TABLE will move table data to the HDFS Trash instead.

How was this patch tested?

  1. unit test
  2. Manually test

Was this patch authored or co-authored using generative AI tooling?

no

@github-actions github-actions Bot added the kind:documentation Documentation is a feature! label Mar 27, 2026
@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Mar 27, 2026

it would be great if you could add a test coverage for the newly introduced config, but this is optional if you think it's not easy to write.

@maomaodev
Copy link
Copy Markdown
Contributor Author

maomaodev commented Mar 27, 2026

it would be great if you could add a test coverage for the newly introduced config, but this is optional if you think it's not easy to write.

The newly introduced config is indeed not easy to cover with unit tests, but I tested it in my local environment and the parameter works correctly. Would you mind reviewing it again? Thanks.

  1. drop table dy default, the data is actually moved to the .Trash/Current directory.
Clipboard_Screenshot_1774659455 Clipboard_Screenshot_1774659533
  1. drop table by setting dropTableAsPurgeTable=true, the data is moved by skipping HDFS trash.
Clipboard_Screenshot_1774659855 Clipboard_Screenshot_1774659895

@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Mar 29, 2026

please update the PR description to reflect the eventual state of this PR

@github-actions github-actions Bot removed the kind:documentation Documentation is a feature! label Mar 29, 2026
@maomaodev
Copy link
Copy Markdown
Contributor Author

please update the PR description to reflect the eventual state of this PR

updated.

@github-actions github-actions Bot added the kind:documentation Documentation is a feature! label Mar 29, 2026
@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Mar 29, 2026

@maomaodev sorry, the CI stopped working due to ASF's recent change, I opened #7372 to fix it, and you need to rebase this PR after it gets merged (likely tomorrow). Apologies for the inconvenience.

@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Mar 30, 2026

@maomaodev I merged #7372, could you please rebase master to trigger the CI?

@maomaodev
Copy link
Copy Markdown
Contributor Author

maomaodev commented Mar 30, 2026

@maomaodev I merged #7372, could you please rebase master to trigger the CI?

done

@pan3793 pan3793 added this to the v1.12.0 milestone Mar 30, 2026
@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Mar 30, 2026

thanks, merging to master

@pan3793 pan3793 closed this in c237522 Mar 30, 2026
@maomaodev
Copy link
Copy Markdown
Contributor Author

thanks, merging to master

Thanks for the quick review and merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants