Databases Reference
In-Depth Information
Column Family (CF): A column family resembles an RDBMS table closely and is an
ordered collection of rows, which in turn are ordered collections of columns.
A column family can be a “standard” or a “super” column family. A row in a standard
column family contains collections of name/value pairs whereas the row in a super
column family holds collections of super columns (group of sub-columns).
An example for a column family is described below (in JSON):
Employee = { // Employee Column Family
"10029277" : { // Row key for Employee ID - 10029277
// Collection of name value pairs
"EmpName" :"SM",
"mail" :"<a href="mailto: SM@xyz.com "> SM@xyz.com </a>",
"phone" : "9999900000"
//There can be N number of columns
},
"10099999" : { // Row key for Employee ID - 10099999
// Collection of name value pairs
"EmpName" :"MJ",
"mail" :"<a href="mailto: MJ@xyz.com "> MJ@xyz.com </a>",
"phone" : "9090909090"
},
"10199999" : { // Row key for Employee ID - 10199999
// Collection of name value pairs
"EmpName" :"HS",
"mail" :"<a href="mailto: HS@xyz.com "> HS@xyz.com </a>",
"phone" : "9099909990"
}
}
Each column would contain “time stamp” by default. for easier narration, time
stamp is not included here.
Note
The address of a value in a regular column family is a row key pointing to a column
name pointing to a value, while the address of a value in a column family of type “super”
is a row key pointing to a column name pointing to a sub-column name pointing to a
value. An example for a super column in JSON format is as follows:
Specialization = { // Super column family
"10029277" : { // Row key for Employee ID - 10029277
//Specialization skills by the employee with ID - 10029277
"Skill1" : {"skillcode" : "skill1", "value": "BI",},
"Skill2" : {"skillcode" : "skill2", "value": "DW",},
"Skill3" : {"skillcode" : "skill3", "value": "CRM",},
"Skill4" : {"skillcode" : "skill4", "value": "Analytics",},
"Skill5" : {"skillcode" : "skill5", "value": "Big Data",}
}
 
 
Search WWH ::




Custom Search