Question : Last column in a primary key represent partition key 1. True 2. False
Correct Answer : 2 Explanation: First column, defined in partition key is always partition key.
Example primary key ((state), id)
Then state is a partition key.
Question : Which of the following is true, with regards to Cassandra clustering columns 1. Itas not mandatory to define
2. It helps to define sort order on a particular column
3. You can change ordering either ascending or descending using WITH CLUSTERING ORDER BY while creating table
4. 1 and 3
5. 2 and 3
Correct Answer : 5 Explanation: : In a simple primary key, Apache Cassandra uses the first column name as the partition key. (Note that Cassandra can use multiple columns in the definition of a partition key.) In the music service's playlists table, id is the partition key. The remaining columns can be defined as clustering columns. In the playlists table below, the song_order is defined as the clustering column: PRIMARYKEY (id, song_order)); The data for each partition is clustered by the remaining column or columns of the primary key definition. On a physical node, when rows for a partition key are stored in order based on the clustering columns, retrieval of rows is very efficient. For example, because the id in the playlists table is the partition key, all the songs for a playlist are clustered in the order of the remaining song_order column. The others columns are displayed in alphabetical order by Cassandra.
Question : You are doing development using Python programming language, now you need to execute some select query on the data stored in Cassandra, hence you will be using driver for that. Which of the following are correct statement with regards to driver?
1. Cassandra does not support driver for Python, you must have to use Java for this.
2. Cassandra requires new driver class instance for each Cassandra select query
3. Cassandra requires new Cluster class instance for each Cassandra select query
4. You will typically have one instance of Cluster for each Cassandra cluster you want to interact with
Correct Answer : 4 Explanation: : Before we can start executing any queries against a Cassandra cluster we need to setup an instance of Cluster. As the name suggests, you will typically have one instance of Cluster for each Cassandra cluster you want to interact with.
from cassandra.cluster import Cluster cluster = Cluster()