I am using below CQL syntax to create keyspace only if does not exists :
CREATE KEYSPACE IF NOT EXISTS Test WITH replication
= {'class':'SimpleStrategy', 'replication_factor':1};
but it is giving error :
Exception in thread "main" com.datastax.driver.core.exceptions.SyntaxError: line 1:23 extraneous input 'EXISTS' expecting '='
at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:35)
at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256)
at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172)
at com.datastax.driver.core.SessionManager.execute(SessionManager.java:91)
at com.datastax.driver.core.SessionManager.execute(SessionManager.java:83)
please help me on this ? whats wrong with syntax ?