Does rowstore table storage type support data type modification or not in Singlestore DB

217 Views Asked by At

I'm currently working with singlestoredb. default storage type for my db is columnstore. I'm aware that columnstore tables will not allow datatype modification in singlestoredb. can anyone please confirm if it is allowed in rowstore tables

1

There are 1 best solutions below

0
user19416376 On

In a columnstore table, you can modify certain aspects, such as adding columns, dropping columns, and changing column names. You can add or drop hash indexes, with a maximum of 32 columns per index. You can also add a column group to an existing table using the ALTER TABLE <table_name> ADD COLUMN GROUP statement. Disabling or enabling automatic statistics collection in a columnstore table is also supported.

However, there are limitations:

You cannot modify the datatype of columns in columnstore tables using ALTER TABLE MODIFY. Columnstore tables do not support changing the datatype of existing columns. You cannot modify the collation of existing columns in columnstore tables. ALTERing PRIMARY, SHARD, or UNIQUE keys is not supported. You cannot modify the SORT KEY (or CLUSTERED COLUMNSTORE KEY) directly via ALTER TABLE. Modifying computed columns is not directly supported. The suggested approach is to drop the computed column and add a new one with the updated formula. You will have to create a new table and insert the old table content into the new table and swap the name.