TRUNCATE fails for columstore tables

Dear Team!

I have run into a problem while trying to truncate some tables.

TRUNCATE account_history_v0;

SQL Error [1890] [HY000]: ALTER TABLE which modifies type of column `changed_at` is not supported on a columnstore table.

Table structure:

It seems with the following two prerequisites the error is to appear during truncation:

  • Table is created as a columnstore table
  • There is a computed column set as primary key

We have started marking the computed column as unique instead of primary which seems to solve the issue, but I would like to ask:

  • Is it a known/valid behavior of the system or an error?
  • Why does TRUNCATE return an ALTER TABLE error in this case? I am not altering the structure, only emptying the content of the table.

Thank You for your help in advance!
BR
Attila

Hi Attila! :wave: Welcome! Cute fox avatar. Where is it from; a game?

Could you tell me if you are running on a managed or self-hosted service and what version?

Hi Maria! Thanks for the quick reply :slight_smile: The fox is from a Star Fox 64 parody made by Terminal Montage.
We have the DB in managed form and as I see the current version is 7.6.16.

Hi Attila! I knew I recognized it from somewhere. Very cool! Thanks for sharing.

Since you’re on the managed service, feel free to contact :rescue_worker_helmet: support. :rescue_worker_helmet:They are happy to create a support ticket to answer all of your questions and can offer more details.

Best Regards. :fox_face: