Dmitri Korotkevitch shows a way of dealing with non-empty partitions on columnstore indexes:
The common, by the book approach recommends dropping columnstore index, splitting or merging partitions and recreating the index afterwards. As you can imagine, it would lead to extremely inefficient process with huge amount of unnecessary overhead on large tables. After all, you have to drop and recreate columnstore index, converting table to Heap, while just subset of the partitions needs to be rebuilt. Fortunately, you can minimize the overhead with simple workaround:
-
Switch partition(s) to split or merge to the separate staging table
-
Split or merge partition(s) in the main table. You can do that because partitions will be empty after the previous step
-
Drop columnstore index in the staging table, split/merge partition(s) there and recreate the index afterwards
-
Switch partition(s) back from staging to the main table.
Read on for a detailed walkthrough of these steps.