cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Holmberg <adam.holmb...@datastax.com>
Subject Re: getting column names
Date Wed, 17 Dec 2014 20:00:02 GMT
Stephen,

This topic is more appropriate for the python-driver-user list:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/python-driver-user

Can we pick this up there, with a little further information including your
table definition?

Adam

On Fri, Dec 12, 2014 at 1:04 PM, Stephen Jones <sjones@imageworks.com>
wrote:

>
> Hello there -
>
> I'm using the python-driver to get my queried rows with a row factory
> that's a dictionary. When I get back my row list, each list item is a
> dictionary, but the keys are hashes. Is there any way use the column family
> metadata to decrypt the dictionary keys to their original column names?
> Thanks for the help.
>
> >>import cassandra
> >>from cassandra.cluster import Cluster
> >>cluster = Cluster(HOSTS)
> >>session = cluster.connect(POOL_NAME)
> >>rows = session.execute('SELECT * FROM "orders_archive" WHERE fruits =
> \'apples\' and >>veggies=\'carrots\' and drinks=\'coke\' ALLOW FILTERING')
> >>row[0].keys()
> [ u'6b6174616e615f7370726566', u'686f7374', u'75736572',
> u'72656e6465725f61726368697665',]
>
> What I need and expect is:
> >>row[0].keys()
> [ u'drinks',u'fruits', u'veggies', u'attr1',]
>
> Any thoughts?
>
> Thanks,
> Stephen Jones
> Email: sjones@imageworks.com
> Ext: 7913-2579
> Current Schedule: 9a - 6p
>
>

Mime
View raw message