On Sep 19, 2012, at 5:25 PM, André Cruz <
andre...@co.sapo.pt> wrote:
>
> CF Test:
> Key -> 'CompositeType(IntegerType, UTF8Type)'
>
> Data:
>
> (1, "TEST1") -> "ASDF": 1
> (1, "TEST2") -> "ASDF": 1
> (2, "TEST1") -> "ASDF": 1
> (3, "TEST1") -> "ASDF": 1
> (4, "TEST1") -> "ASDF": 1
> (4, "TEST2") -> "ASDF": 1
So it seems the idea is to instead have:
1 -> ("TEST1","ASDF"): 1
1 -> ("TEST2","ASDF"): 1
2 -> ("TEST1","ASDF"): 1
3 -> ("TEST1","ASDF"): 1
4 -> ("TEST1","ASDF"): 1
4 -> ("TEST2","ASDF"): 1
Composite type columns instead of keys. This way it's easy to search for 1, it's the key, and if we want (1, "TEST1") it translates to .get(1, column_start=("TEST1",) column_finish=("TEST1",)).
However, I still find that Super CF offer more features and if we are to convert SCF to CF with Composite Types we will loose the ability to perform certain queries or we will have to create multiple CFs to compensate. Let me give a more concrete example. I have this SCF:
CF FileRevision:
KEY FileID (UUID):
SC Revision (UUID)
C "attribute1": value
C "attribute2": value
SC Revision (UUID)
C "attribute1": value
C "attribute2": value
C "attribute3": value
In order not to use Super Columns the schema would look like:
CF FileRevision:
KEY FileID (UUID):
C Revision1:"attribute1": value
C Revision1:"attribute2": value
C Revision2:"attribute1": value
C Revision2:"attribute2": value
C Revision2:"attribute3": value
With this schema I would have some difficulty obtaining the last X revisions of a file, since column_count would count attributes, not revisions. This same query with the SCF would be easy, I could count the SC and I would even get back a nice dictionary with revisions as keys and sub-dictionaries for the attributes. In order to correctly answer this query without using SCF, I could add another CF and thus end up with:
CF FileRevision:
KEY FileID (UUID):
C Revision1: ''
C Revision2: ''
CF RevisionData:
KEY FileID:Revision1:
C "attribute1": value
C "attribute2": value
KEY FileID:Revision2:
C "attribute1": value
C "attribute2": value
C "attribute3": value
This way I can retrieve the last X revisions of a file from the FileRevision CF, but for the revision details I would need to fetch them from another CF. I don't really see the advantage of not using SCF.
Best regards,
André