[
https://issues.apache.org/jira/browse/CASSANDRA-20761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18005157#comment-18005157
]
Stefan Miklosovic commented on CASSANDRA-20761:
-----------------------------------------------
1) there is already TRUNCATE COLUMNFAMILY table and TRUNCATE TABLE table
2) We can either stop once some table fails to truncate or we can iterate over
all tables and record these which failed to be truncated. I would most probably
go with the first approach. I am not completely sure how TCM would be used
here.
> Support TRUNCATE <keyspace> to truncate all tables in it
> --------------------------------------------------------
>
> Key: CASSANDRA-20761
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20761
> Project: Apache Cassandra
> Issue Type: New Feature
> Components: CQL/Semantics
> Reporter: Stefan Miklosovic
> Priority: Normal
>
> If I want to truncate whole keyspace by one command, now I can not do that as
> I need to enumerate all tables from that keyspace and truncate one by one.
> It might be probably possible to do
> {code}
> TRUNCATE keyspace_name
> {code}
> which would internally iterate over all tables and truncate them all so user
> is saved from doing that.
> However, I think that the usage of
> {code}
> TRUNCATE keyspace_name
> {code}
> is a little bit risky because, for example, users might think that they are
> using keyspace already by USE statement so "keyspace_name" is actually a
> table name. If there is a keyspace of such name then it would truncate all
> tables in it.
> It would be probably better to have a new statement like
> {code}
> TRUNCATE KEYSPACE abc;
> {code}
> That way, it is pretty obvious what we want to truncate.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]