use of com.datastax.driver.core.utils.CassandraVersion in project java-driver by datastax.
the class IndexMetadataTest method should_allow_multiple_indexes_on_map_column.
@Test(groups = "short")
@CassandraVersion("3.0")
public void should_allow_multiple_indexes_on_map_column() {
String createEntriesIndex = String.format("CREATE INDEX map_all_entries_index ON %s.indexing (entries(map_all));", keyspace);
session().execute(createEntriesIndex);
String createKeysIndex = String.format("CREATE INDEX map_all_keys_index ON %s.indexing (keys(map_all));", keyspace);
session().execute(createKeysIndex);
String createValuesIndex = String.format("CREATE INDEX map_all_values_index ON %s.indexing (values(map_all));", keyspace);
session().execute(createValuesIndex);
ColumnMetadata column = getColumn("map_all");
TableMetadata table = (TableMetadata) column.getParent();
assertThat(getIndex("map_all_entries_index")).hasParent(table).asCqlQuery(createEntriesIndex);
assertThat(getIndex("map_all_keys_index")).hasParent(table).asCqlQuery(createKeysIndex);
assertThat(getIndex("map_all_values_index")).hasParent(table).asCqlQuery(createValuesIndex);
}
Aggregations