if we alter table with new TTL value , if the TTL value of the existing records in that table will also get changed or the new TTL value will be applicable only for new records coming into the table post table alter
if we alter table with new TTL value , if the TTL value of the existing records in that table will also get changed or the new TTL value will be applicable only for new records coming into the table post table alter
Changing the default TTL does not update the expiration on existing data.
Cassandra SSTables are immutable -- they do not change once they've been written to disk. If you change the default TTL, you will need to update the existing data to reflect the change.
You need to write an app (for example in Spark) that would read each partition, recalculate the TTL on it then save it. There isn't a ready-made solution for this so you'll have to develop one yourself. Cheers!
5 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use