C*,

I'm trying to use composite column names to organize 10**8 records. Each record has a unique pair of UUIDs. The first UUID is often repeated, so I want to use column_start and column_finish to find all the records that have a given UUID as the first UUID in the pair.

I thought a simple way to get *all* of the columns would be to use

 start  = uuid.UUID(int=0)        -> 00000000-0000-0000-0000-000000000000
 finish = uuid.UUID(int=2**128-1) -> ffffffff-ffff-ffff-ffff-ffffffffffff

But strangely, this fails to find *any* of the columns, and it requires that column_reversed=True -- otherwise it raises an error about range finish not coming after start. If I use ints that are much larger/smaller than these extremes, then reversed is not required!

Can anyone explain why LexicalUUIDType() does not treat these extremal UUIDs like other UUIDs?


Using pycassa v1.9:

    sm = SystemManager(chosen_server)
    sm.create_keyspace(namespace, SIMPLE_STRATEGY, {'replication_factor': '1'})

    family = 'test'
    sm.create_column_family(
        namespace, family, super=False,
        key_validation_class = ASCII_TYPE,
        default_validation_class = BYTES_TYPE,
        comparator_type=CompositeType(LexicalUUIDType(), LexicalUUIDType()),
        #column_name_class = LEXICAL_UUID_TYPE
        )

    pool = ConnectionPool(namespace, config['storage_addresses'],
                          max_retries=1000, pool_timeout=10, pool_size=2, 
timeout=120)

    cf = pycassa.ColumnFamily(pool, family)
    u1, u2, u3, u4 = uuid.uuid1(), uuid.uuid1(), uuid.uuid1(), uuid.uuid1()

    cf.insert('inbound', {(u3, u3): b'43'})

    start  = uuid.UUID(int=0)
    finish = uuid.UUID(int=2**128-1)
    print start
    print finish
    assert start < u3 < finish
    print cf.get('inbound', column_start=(start,), column_finish=(finish,), 
column_reversed=True).items()

    sm.close()



Raises:
            if len(list_col_or_super) == 0:
              raise NotFoundException()
E               NotFoundException: NotFoundException(_message=None)

../../ve/local/lib/python2.7/site-packages/pycassa/columnfamily.py:663: 
NotFoundException



jrf

Reply via email to