Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Exclusive get count
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tyler Hobbs  
View profile  
 More options Sep 27 2012, 1:56 pm
From: Tyler Hobbs <ty...@datastax.com>
Date: Thu, 27 Sep 2012 12:56:55 -0500
Local: Thurs, Sep 27 2012 1:56 pm
Subject: Re: Exclusive get count

I haven't had time to test this, but it looks like you have another problem
with single-element tuples.

Your version: result2 = cf.get('dummy_key', column_start=((key[0], False)))

The correct version:  result2 = cf.get('dummy_key', column_start=((key[0],
False),))

On Wed, Sep 26, 2012 at 10:53 PM, Cato Yeung <cato.ye...@gmail.com> wrote:
> I found that when I exclusively get datetype composite column, the result
> is not correct.
> I have made a simplified version of what I want to do here:
> import pycassa
> import datetime

> if __name__ == '__main__':
>     # initialize pool and column family
>     pool = pycassa.ConnectionPool('InviteAppRevamp2',
> server_list=['192.168.1.41:9160'], pool_size=1)
>     cf = pycassa.ColumnFamily(pool, 'test2')

>     # get current datetime
>     dt = datetime.datetime.now()
>     print 'current datetime: '+str(dt)

>     # insert into cassandra database
>     attr = {(dt,): "dummy_value"}
>     cf.insert('dummy_key', attr)

>     # get entry from cassandra database
>     result = cf.get('dummy_key')

>     # get entry from cassandra database, exclusively
>     key, value = result.popitem()
>     print 'datetime in cassandra: '+str(key[0])
>     result2 = cf.get('dummy_key', column_start=((key[0], False)))
>     print
> '----------------------------------------------------------------'
>     print 'I still can get the entry when I specify getting it
> exclusively:'
>     print result2

>     # get entry from cassandra database, inclusively
>     result3 = cf.get('dummy_key', column_start=((key[0], True)))
>     print
> '----------------------------------------------------------------'
>     print 'I still can get the entry when I specify getting it
> inclusively:'
>     print result3

>     # delete entry
>     cf.remove('dummy_key')

> or you can get by gist:
> https://gist.github.com/3792063

> What I want to do is that I can *get and get count exclusively.*
> Cheers,
> Cato

--
Tyler Hobbs
DataStax <http://datastax.com/>

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.