Create views if they don't already exist.
This commit is contained in:
parent
7156d733fa
commit
605529979d
2 changed files with 3 additions and 1 deletions
|
@ -213,7 +213,8 @@ public final class SchemaUtil {
|
||||||
if (o.size() > 0) {
|
if (o.size() > 0) {
|
||||||
clustering = "WITH CLUSTERING ORDER BY (" + String.join(", ", o) + ")";
|
clustering = "WITH CLUSTERING ORDER BY (" + String.join(", ", o) + ")";
|
||||||
}
|
}
|
||||||
return new CreateMaterializedView(keyspace, viewName, where, primaryKey, clustering);
|
return new CreateMaterializedView(keyspace, viewName, where, primaryKey, clustering)
|
||||||
|
.ifNotExists();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SchemaStatement dropMaterializedView(
|
public static SchemaStatement dropMaterializedView(
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.junit.Test;
|
||||||
// See: https://docs.datastax.com/en/cql/3.3/cql/cql_using/useCreateMV.html
|
// See: https://docs.datastax.com/en/cql/3.3/cql/cql_using/useCreateMV.html
|
||||||
// https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlCreateMaterializedView.html
|
// https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlCreateMaterializedView.html
|
||||||
// https://www.datastax.com/dev/blog/materialized-view-performance-in-cassandra-3-x
|
// https://www.datastax.com/dev/blog/materialized-view-performance-in-cassandra-3-x
|
||||||
|
// https://cassandra-zone.com/materialized-views/
|
||||||
public class MaterializedViewTest extends AbstractEmbeddedCassandraTest {
|
public class MaterializedViewTest extends AbstractEmbeddedCassandraTest {
|
||||||
|
|
||||||
static Cyclist cyclist;
|
static Cyclist cyclist;
|
||||||
|
|
Loading…
Reference in a new issue