Database Reference
In-Depth Information
},
key: Spring Training
{
phone: 623-333-3333,
desc: Fun for baseball fans.
},
}, //end of Cambria row
SCkey: (UTF8) Waldorf=Astoria
{
key: Central Park
desc: Walk around. It's pretty.
},
key: Empire State Building
{
phone: 212-777-7777,
desc: Great view from the 102nd floor.
}
}
}
The PointOfInterest super column family has two super columns, each named for a different
hotel (Cambria Suites Hayden and Waldorf=Astoria). The row keys are names of different points
of interest, such as “Phoenix Zoo” and “Central Park”. Each row has columns for a description
(the “desc” column); some of the rows have a phone number, and some don't. Unlike relational
tables, which group rows of identical structure, column families and super column families group
merely similarrecords.
Using the CLI, we could query a super column family like this:
cassandra> get PointOfInterest['Central Park']['The Waldorf=Astoria']['desc']
=> (column=desc, value=Walk around in the park. It's pretty.,
timestamp=1281301988847)
This query is asking: in the PointOfInterest column family (which happens to be defined as
type Super ), use the row key “Central Park”; for the super column named “Waldorf=Astoria”,
get me the value of the “desc” column (which is the plain language text describing the point of
interest).
Composite Keys
There is an important consideration when modeling with super columns: Cassandra does not in-
dex subcolumns, so when you load a super column into memory, all of its columns are loaded as
well.
Search WWH ::




Custom Search