2

this is the command I used for creating a table in Cassandra.

create table materialed_main (car_make text,car_model text,id int,department text,frist text, last text,primary key(car_make,car_model,id));

and this is a materialized view for the above table.

create materialized view materialed_view as select * from materialed_main where first is not null and car_make is not null and car_model is not null and id is not null primary key(first,car_make,car_model, id);

but I'm not sure why I'm getting this error

Error from server: code=2200 [Invalid query] message="Tables cannot have more than 0 materialized views, failed to create materialized view materialed_view on table materialed_main"
Alex Ott
  • 80,552
  • 8
  • 87
  • 132
Abhi Chowdary
  • 23
  • 1
  • 3
  • what cassandra version? have you enabled materialized views ? – Alex Ott Jun 10 '21 at 07:26
  • Thank you @AlexOtt for helping out, I just got to know I should enable materialized views. But how can I enable it in something like Datastax AstraDB, because I think it doesn't have the configuration file to make changes. – Abhi Chowdary Jun 18 '21 at 19:35
  • Ah, it’s Astra. I think that message says that you can’t have MV on it… – Alex Ott Jun 18 '21 at 20:08

2 Answers2

1

From documentation:

Note: Materialized views are not available on Astra serverless databases. For more, see Astra database limits

That second page says:

Secondary indexes and materialized views are not available for serverless databases. Our team is working to offer materialized views for serverless databases soon

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
0

Use CUSTOM INDEX instead of MATERIALIZED VIEW. Storage-Attached Indexing (SAI)

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30478436) – Emi OB Dec 03 '21 at 13:32