During the creation of a table, like in SQL we have DEFAULT to insert a defualt value for a column. type tinyint(1) NOT NULL DEFAULT '0'
Is there anything to achieve the same in Cassandra .
Use the DEFAULT clause in the CREATE TABLE statement to specify the default value for the database server to insert into a column when no explicit value for the column is specified. This syntax fragment is part of the Column definition.
You can't create a table in Cassandra without a primary key, But still if you want to save your data you can add an additional column to your table (let say "pk") with data type UUID.
Cassandra allows 2 billion columns per row.
You can add a column in the table by using the ALTER command. While adding column, you have to aware that the column name is not conflicting with the existing column names and that the table is not defined with compact storage option. Syntax: ALTER TABLE table name.
No, there is no default value in Cassandra. Further more, setting a column value to null means removing it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With