Friday, 24 January 2020

Cassandra: IF NOT EXISTS: Create a table if it is not exist


‘IF NOT EXISTS’ keyword creates a table, if it is not exist, else ignore the execution.

Example
CREATE TABLE IF NOT EXISTS cassandratutorial.employee (
  id INT,
  firstName VARCHAR,
  PRIMARY KEY((id, firstName))
) WITH comment = 'Table to store Employee information';

Previous                                                    Next                                                    Home

No comments:

Post a Comment