question

ritu.kumari1_180415 avatar image
ritu.kumari1_180415 asked Erick Ramirez answered

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

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

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