Column Family, Super Column, Super Column in Kassandra

I would like a clarification. I have the following hierarchy -

Person: {
    personal_details:{
        name:aa
        age:aaa
        ddress:aa
    }
    official_details:{
        employeeid:aa
        cubicle_number:aa
    }
}

      

I would like to represent Person in a Cassandra database. I would like each person to be queried for their SSN (not included in the above hierarchy).

If it was an HBase schema , I would name Person as my table. I would have SSN as my row key and personal_data , and official_details as the column families and name, age, address, employeeid, and cuble_number as columns. What is the cassandra nomenclature for these hierarchies, and what are the possible creation queries for this hierarchy in cassandra?

+3


source to share


1 answer


Check out DataStax documentation on table anatomy .

In this case, creating the data structure you are looking for in Cassandra CQL will be very similar to SQL.



CREATE TABLE people 
(
  ssn text PRIMARY KEY,
  name text,
  age int,
  address text,
  employeeid int,
  cubicle_number int
);

      

About superteams on Kassandra, now deprecated .

+3


source







All Articles