Question : When multiple occurrences of data match a condition in a WHERE clause, Cassandra selects the most-frequent occurrence of a condition for processing first for efficiency.
1. True 2. False
Correct Answer : Get Lastest Questions and Answer : Explanation: When multiple occurrences of data match a condition in a WHERE clause, Cassandra selects the least-frequent occurrence of a condition for processing first for efficiency. For example, suppose data for author "HadoopExam" and "Book Name :CASSANDRA" were inserted into the books table. Cassandra queries on the category name first if there are fewer categories named "NOSQL" than there are books called "Cassandra" in the database.
SELECT * FROM Books WHERE category = 'NoSQL' AND title = 'Cassandra' ALLOW FILTERING ;
When you attempt a potentially expensive query, such as searching a range of rows, Cassandra requires the ALLOW FILTERING directive.
Question : You have been given two separate csv file as below.
subscriber.csv (All the subscriber of the training course, it is possible a single company can have multiple user) 62c36092-82a1-3a00-93d1-46196ee77204, {hadoopexam@gmail.com, admin@hadoopexam.com} , Amit Jain
Which of the following is correct way to accommodate these data in Cassandra table?
A. CREATE TABLE HADOOPEXAM { course_id timeuuid, title text, Category set }
CREATE TYPE SUBSCRIBER_TYPE { course_id timeuuid, emails set, name text }
ALTER TABLE HADOOPEXAM add SUBSCRIBER frozen;
B.
CREATE TYPE SUBSCRIBER_TYPE { course_id timeuuid, emails set, name text }
Correct Answer : Get Lastest Questions and Answer : Explanation: Both option 1 and 2 are correct. As you know, for unique text values we can use set type. We can use map type only if there are keys and values.
We can first create table and alter later on to add new column. or we can define table with have all the columns at first.
To create custom type, we have to use syntax as below.
CREATE TYPE SUBSCRIBER_TYPE { course_id timeuuid, emails set, name text }