Ich habe den Ortstyp als statische Spalte definiert.Wie Abfrage Cassandra mit statischen Spalte?
Ich möchte Daten auf statische Spalte filtern.
select count(*) from device_stats_by_location where locationtype = "garage";
Aber ich bin vor Ausnahme -
InvalidRequest: code=2200 [Invalid query] message="Predicates on non-primary-key columns (locationtype) are not yet supported for non secondary index queries"
So versucht ...
cqlsh:device_data> CREATE INDEX locationtype_indx on device_stats_by_location (locationtype);
die Fehlermeldung ...
InvalidRequest: code=2200 [Invalid query] message="Secondary indexes are not allowed on static columns"
Meine Frage ist - Wie kann ich statische Spalte in CQL-Abfrage verwenden?
Warum haben Sie statische Spalte verwendet? Was ist dein Anwendungsfall? –
locationtype ist für alle Zeilen mit demselben Partitionsschlüssel festgelegt –
Datenmodell => ** locationid (Pk), endof10minwindow (Ck1), Gerätekategorie (Ck2), Geräteanzahl, Positionstyp (S), Region (S) ** => für eine gegebene locationid wird sagen, dass 2000 Reihen zusammen gruppiert sind, die den gleichen locationtype und region haben => das ist, warum ** sie als statisch spezifiziert haben ** => was ist der beste Ansatz um die Daten nach locationtype abzufragen? –