cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kumar Ranjan <winnerd...@gmail.com>
Subject Re: Cassandra pytho pagination
Date Thu, 19 Dec 2013 18:22:47 GMT
Rob - I got a question following your advice. This is how, I define my
column family

validators = {

    'approved':            'UTF8Type',

    'tid':                 'UTF8Type',

    'iid':                 'UTF8Type',

    'score':               'IntegerType',

    'likes':               'IntegerType',

    'retweet':             'IntegerType',

    'favorite':            'IntegerType',

    'screen_name':         'UTF8Type',

    'created_date':        'UTF8Type',

    'expanded_url':        'UTF8Type',

    'embedly_data':        'BytesType',

}

SYSTEM_MANAGER.create_column_family('KeySpaceNNN', 'Twitter_Instagram',
default_validation_class='UTF8Type', super=True, comparator='UTF8Type',
key_validation_class='UTF8Type', column_validation_classes=validator)

Actual data representation:

'row_key': {'1234555665_53323232': {'approved': 'false', 'tid':
123,  'iid': 346666, 'score': 2, likes: 50, retweets: 45, favorite: 34,
screen_name:'goodname'},

                '2344555665_53323232': {'approved': 'false', 'tid':
134,  'iid': 346666, 'score': 2, likes: 50, retweets: 45, favorite: 34,
screen_name:'newname'}.

                .....

               }

Is there something wrong with it? Here 1234555665_53323232 and
2344555665_53323232 are super columns. Also, If I have to represent this
data with new composite comparator, How will I accomplish that?


Please let me know.


Regards.


On Wed, Dec 18, 2013 at 5:32 PM, Robert Coli <rcoli@eventbrite.com> wrote:

> On Wed, Dec 18, 2013 at 1:28 PM, Kumar Ranjan <winnerdood@gmail.com>wrote:
>
>> Second approach ( I used in production ):
>> - fetch all super columns for a row key
>>
>
> Stock response mentioning that super columns are anti-advised for use,
> especially in brand new code.
>
> =Rob
>
>

Mime
View raw message