what exactly is a map dimension in a multi-dimensional map?
Asked Answered
C

2

13

Like many these days, I am an old relational-model user approaching Cassandra for the first time. I have been trying to understand Cassandra's data model, and when I read about it I frequently encounter statements that encourage me to think about it as 4 and 5 dimensional maps.

Now I'm familiar with an ordinary key/value Map, but I have never thought of how many dimensions it has, and that gives me no basis to plunge headlong into trying to visualize 4 and 5 dimensions.

Is there a more gentle introduction to dimensionality in maps? How many dimensions are there in an ordinary hashtable? One? Two? Zero?

If an ordinary hashtable has, say, just one dimension, then what would a two-dimensional map be? If two, then what would a 3-dimensional map be?

Cuticula answered 19/4, 2011 at 16:14 Comment(0)
P
21
Map<String, String>                           -- One dimension
Map<String, Map<String, String>>              -- Two dimensions
Map<String, Map<String, Map<String,String>>>  -- Three dimensions

etc...

Pyromagnetic answered 19/4, 2011 at 20:6 Comment(2)
In retrospect, the concept is the same as dimensionality in arrays: a two-dimensional array is an array-of-arrays, a two-dimensional map is a map-of-maps, etc. I'm not sure why this didn't occur to me earlier.Cuticula
It seems that the existence of Column Family could be described more precisely as: Map<String, List<Map<String, String>> >, i.e. Column Family is a list of map. Am I right?Elmaelmajian
Z
3

Encouraging you to think of it as 4 or 5 dimensional maps is one of the best signs that the author of what you're reading doesn't know what he's talking about.

Read the Max Grinev posts linked at the top of http://wiki.apache.org/cassandra/ArticlesAndPresentations instead.

Zooplasty answered 20/4, 2011 at 15:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.