incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Cobley <a.e.cob...@dundee.ac.uk>
Subject CQL get unique row keys ?
Date Sat, 15 Feb 2014 17:05:56 GMT
I may be missing something here, but is there a way in cql to get all unique row keys in a
column family(table) ?

I’ve created a table like this:

CREATE TABLE totp (
artist varchar,
track varchar,
 appearance_type varchar,
 PRIMARY KEY ((artist),track)
) WITH CLUSTERING ORDER BY (track asc);

and populated it with data.  As you can imagine, each artist can have multiple tracks .  Doing:

Select * from totp; will produce something like (with more artists of course)

                   The Tony Rich Project |                             Nobody Knows |    
        P/A
                            Telly Savalas |                                       If |   
       PROMO
                             Alice Cooper |                                  Elected |   
        DISC
                             Alice Cooper |                             Hello Hooray |   
       PROMO
                             Alice Cooper |                               Hey Stupid |   
       Promo
                             Alice Cooper |                          Lost In America |   
         P/A
                             Alice Cooper |                      No More Mr.Nice Guy |   
        DISC
                             Alice Cooper |                                   Poison |   
       Promo
                             Alice Cooper |                             School's Out |   
     P/A V/T
                             Alice Cooper |                              Schools Out |   
         P/A
                             Alice Cooper |                       Teenage Lament '74 |   
        DISC
                  Blackstreet Feat Dr.Dre |                               No Diggity |   
         P/A
                                     Nena |                           99 Luftballons |   
       Promo
                                     Nena |                          99 Red Balloons |   
         P/A
and Select artist from totp; would produce:

                    The Tony Rich Project
                            Telly Savalas
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                             Alice Cooper
                  Blackstreet Feat Dr.Dre
                                     Nena
                                     Nena

But of course what I really want is just the row keys
    The Tony Rich Project
                            Telly Savalas
                             Alice Cooper
                  Blackstreet Feat Dr.Dre
                                     Nena

Any idea if I can do this in CQL ?

Andy


The University of Dundee is a registered Scottish Charity, No: SC015096

Mime
View raw message