title: Cassandra CQL3 select row keys from table with compound primary key
body: <p>I'm using Cassandra 1.2.7 with the official Java driver that uses CQL3. </p>
  
  <p>Suppose a table created by</p>
  
  <pre><code>CREATE TABLE foo ( 
      row int, 
      column int, 
      txt text, 
      PRIMARY KEY (row, column)
  );
  </code></pre>
  
  <p>Then I'd like to preform the equivalent of <code>SELECT DISTINCT row FROM foo</code></p>
  
  <p>As for my understanding it should be possible to execute this query efficiently inside Cassandra's data model(given the way compound primary keys are implemented) as it would just query the 'raw' table.</p>
  
  <p>I searched the CQL documentation but I didn't find any options to do that.</p>
  
  <p>My backup plan is to create a separate table - something like</p>
  
  <pre><code>CREATE TABLE foo_rows (
      row int,
      PRIMARY KEY (row)
  );
  </code></pre>
  
  <p>But this requires the hassle of keeping the two in sync - writing to foo_rows for any write in foo(also a performance penalty).</p>
  
  <p>So is there any way to query for distinct row(partition) keys?</p>