How do you change a column from NULL to NOT NULL in memSQL.
I have created the table as below.
create table t_tinyint1(c TINYINT,c2 VARCHAR(100), key() USING CLUSTERED COLUMNSTORE);
Trying to alter but no luck
ALTER TABLE t_tinyint1 modify c2 VARCHAR(100) not null ;
Facing the below error.
SQL Error [1890] [HY000]: This version of MemSQL cannot perform an offline ALTER TABLE on a COLUMN STORE table. The requested ALTER TABLE cannot be performed online because it modifies column c2 from NULL to NOT NULL.
Consider adding a new column with the desired type, updating it with the new data, then dropping the old one. After that, rename the new column to the original column name. Could take a long time for a large table, but it should work.
This is still on our backlog. You can’t yet do this in a single step. I expect us to make more ALTERs like this possible at a future date.
Also, you can change the column order as described here. That can be useful if you solve this by making a new column, updating it, and removing the old one, and renaming the new one, so you wind up with the same column order as you originally had.