You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined a table and a type and added via a session to Cassandra-rs like so:
let create_type = r#" CREATE TYPE moviedb.person ( name text, gender text ); "#;let create_table = r#" CREATE TABLE IF NOT EXISTS moviedb.movies ( name text, mid int, year int, rank float, director text, cast list<frozen<map<person,text>>>, // lists person and their role PRIMARY KEY (name, mid) );"#;let result = {
session.execute(create_keyspace).await.unwrap();
session.execute(create_type).await.unwrap();
session.execute(create_table).await.unwrap()};Ok(result)
and I get this error: Cassandra error LIB_INDEX_OUT_OF_BOUNDS: Index out of bounds
(the List:new() was used because I followed the example file, however, I can't figure out how to use UDT or define a UDT in code.)
The goal with this code is to add a person to a cast list, along with their listed role. For the life of me, I cant figure this out. My apologies about the code styling, if there's anything you guys see wrong feel free to suggest corrections :)
The text was updated successfully, but these errors were encountered:
I defined a table and a type and added via a session to Cassandra-rs like so:
and I have a Rust
Person
struct defined like so:I have a
Vec<(Person, String)>
containing aperson
and their role, defined ascast
, and is itererated through with this code:and I get this error:
Cassandra error LIB_INDEX_OUT_OF_BOUNDS: Index out of bounds
(the
List:new()
was used because I followed the example file, however, I can't figure out how to use UDT or define a UDT in code.)The goal with this code is to add a person to a cast list, along with their listed role. For the life of me, I cant figure this out. My apologies about the code styling, if there's anything you guys see wrong feel free to suggest corrections :)
The text was updated successfully, but these errors were encountered: