diff --git a/cql3/statements/create_index_statement.cc b/cql3/statements/create_index_statement.cc index 8167faaefc..3110b554f3 100644 --- a/cql3/statements/create_index_statement.cc +++ b/cql3/statements/create_index_statement.cc @@ -87,6 +87,9 @@ std::vector<::shared_ptr> create_index_statement::validate_while_e "Secondary indexes are not supported on COMPACT STORAGE tables that have clustering columns"); } + if (!db.features().views_with_tablets && db.find_keyspace(keyspace()).get_replication_strategy().uses_tablets()) { + throw exceptions::invalid_request_exception(format("Secondary indexes are not supported on base tables with tablets (keyspace '{}')", keyspace())); + } validate_for_local_index(*schema); std::vector<::shared_ptr> targets; diff --git a/cql3/statements/create_view_statement.cc b/cql3/statements/create_view_statement.cc index f934c30346..e5ba3c6127 100644 --- a/cql3/statements/create_view_statement.cc +++ b/cql3/statements/create_view_statement.cc @@ -140,6 +140,9 @@ std::pair create_view_statement::prepare_view( schema_ptr schema = validation::validate_column_family(db, _base_name.get_keyspace(), _base_name.get_column_family()); + if (!db.features().views_with_tablets && db.find_keyspace(keyspace()).get_replication_strategy().uses_tablets()) { + throw exceptions::invalid_request_exception(format("Materialized views are not supported on base tables with tablets")); + } if (schema->is_counter()) { throw exceptions::invalid_request_exception(format("Materialized views are not supported on counter tables")); }