I'm looking through the object mapping sections and I am wondering if there is a way to find out what columns have what properties. That is, after connecting to a cluster, can I create a table object x that is test.x. And then, from python simply go, "what are the static/primary/partition/clustering columns in x?" I could figure this out from doing a describe tables from cqlsh, but I was wondering if there was something already like this?
To unsubscribe from this group and stop receiving emails from it, send an email to python-driver-u...@lists.datastax.com.
print cl.keyspaces["tests"].tables["albums"] # make text partition_key # state text partition_key # day timestamp clustering_key # event_time timestamp clustering_key # dealership text # year int # salesman text # distributor_lead text static # account_lead text static
The traditional method for viewing this in CQL is this:
print cl.metadata.keyspaces["tests"].tables["sold_cars"].export_as_string() #CREATE TABLE tests.sold_cars ( # make text, # state text, # day timestamp, # event_time timestamp, # account_lead text static, # dealership text, # distributor_lead text static, # salesman text, # year int, # PRIMARY KEY ((make, state), day, event_time)