I am using the Cassandra Java Driver, v.4.6.1.
While creating an instance of my DAO instance, I hit the following error:
com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Some clustering keys are missing: primary_genre, feed_url
Those are indeed my clustering keys, however I'm not sure what they are missing from.
The error appears similar to this one, except the difference is that I didn't realize I was even hitting the db. The stack trace shows that this error comes up on the bottom line, where I'm creating a DAO instance:
InventoryMapper inventoryMapper = InventoryMapper.builder(db.session).build(); PodcastDao dao = inventoryMapper.podcastDao("podcast_analysis_tool", "podcasts_by_language");
Here is some of my other code, in case it's helpful
InventoryMapper class :
@Mapper public interface InventoryMapper { @DaoFactory PodcastDao podcastDao(@DaoKeyspace String keyspace, @DaoTable String table); }
Class definition:
@Entity @CqlName("podcasts_by_language") public class Podcast { @PartitionKey private String language; @ClusteringColumn(1) private String primaryGenre; @ClusteringColumn(2) private String feedUrl; ... }
CQL to define the table:
CREATE TABLE IF NOT EXISTS podcast_analysis_tool.podcasts_by_language (owner TEXT, name TEXT, image_url30 TEXT,image_url60 TEXT,image_url100 TEXT,image_url600 TEXT, api TEXT, api_id TEXT, api_url TEXT, country TEXT,feed_url TEXT, genres LIST<TEXT>, api_genre_ids LIST<TEXT>,primary_genre TEXT,release_date TIMESTAMP,explicit BOOLEAN,episode_count INT,rss_feed TEXT,found_by_queries List<frozen<Map<Text, Text>>>, description TEXT,summary TEXT,description_subtitle TEXT,webmaster TEXT,owner_email TEXT,author TEXT,language TEXT,website_url TEXT,updated_at TIMESTAMP, PRIMARY KEY ((language), primary_genre, feed_url)) WITH CLUSTERING ORDER BY(primary_genre ASC, feed_url ASC);