Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

ritu.kumari1_180415 avatar image
ritu.kumari1_180415 asked ·

Why can't I set TimeWindowCompactionStrategy compaction_window_size to 'Days'?

I am trying to update compaction of a table using below query

ALTER TABLE s2.splash WITH compaction = {'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 'compaction_window_size': '8', 'compaction_window_unit': 'Days'}; 

it fails with below error:

ConfigurationException: <Error from server: code=2300 [Query invalid because of configuration issue] message="Days is not valid for compaction_window_unit">

Any suggestion here?

compactiontwcs
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

The option is case-sensitive which is why it failed.

You should be able to set it to 'DAYS' like this:

ALTER TABLE s2.splash WITH compaction = {'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy', 'compaction_window_size': '8', 'compaction_window_unit': 'DAYS'}; 

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.