phoenix
phoenix copied to clipboard
PHOENIX-300 Add support for TRUNCATE TABLE
- Added support for TRUNCATE TABLE
statement in phoenix.
- Added an integration test to test the feature.
Please do not use private JIRA IDs in the Apache project. Use the PHOENIX-300 ticket ID.
There are a few issues to be addressed:
- child tables (global secondary index tables and and global secondary indexes on views) also need to be handled.
- This doesn't work for multitenant tables from tenant-specific connections (i think simply erroring out in that case is fine)
- Some sanity checks for critical system tables would also be needed.
- Need to think about what happens when trying to access the tables while truncating.
You are preserving the splits during truncate, which is good, but you may also want to consider exposing an option that lets users remove the existing split points. (not for salted tables, of course.)
Thanks for looking into these changes. How about we provide an extension to the TRUNCATE TABLE statement to preserve the splits? We can have an optional clause something like:
TRUNCATE TABLE
That sounds good, @ragarkar .
Or rather make preserving splits the default, and add an option to NOT preserve them.