title: How to query a field in a user defined type in a set using CQL (Cassandra)
body: <p>I am using the User Defined Types in CQL 3.1 (cqlsh info below):</p>
  
  <pre><code>[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3]
  </code></pre>
  
  <p>I have created the following user-defined type (simplified here for demonstration purposes):</p>
  
  <pre><code>create type fullname ( firstname text, lastname text );
  </code></pre>
  
  <p>I then created a table that includes a set of type fulsome:</p>
  
  <pre><code>create table people ( id UUID primary key, names set &lt; frozen &lt;fullname&gt;&gt; );
  </code></pre>
  
  <p>I can insert rows into the table using:</p>
  
  <pre><code>insert into people (id, names) values (
    now(), 
    {{firstname: 'Jim', lastname: 'Jones'}}
  );
  </code></pre>
  
  <p>The result looks good:</p>
  
  <pre><code>select * from people;
  
   id                                   | names
  --------------------------------------+-----------------------------------------
   69ba9d60-a06b-11e4-9923-0fa29ba414fb | {{firstname: 'Jim', lastname: 'Jones'}}
  </code></pre>
  
  <p>My question is this:  how do I fetch all of the first name entries?  If I was not using set, and just fullname, I could use the dot notation:</p>
  
  <pre><code>select name.firstname from people;
  </code></pre>
  
  <p>But that obviously doesn't work, because I am using a set.  In normal usage (without a UDT), a set would never have need for dot notation, because all of the entries would be of a simple type (text, UUID, etc).  I tried using all of the usual suspects from other programming languages...</p>
  
  <pre><code>select names.firstname...
  select names[].firstname...
  select names['firstname']...
  </code></pre>
  
  <p>About the only information on UDT's on the web is from the <a href="http://www.datastax.com/documentation/cql/3.1/cql/cql_using/cqlUseUDT.html">DataStax web site</a>, which doesn't get into this use case. </p>
  
  <p>Anybody tried this before?  Or is what I am doing just plain not allowed?</p>
  
  <p>Thanks,</p>
  
  <p>John</p>