title: Cassandra Failed Format Value
body: <p>I am following the article for using group by: <a href="http://www.batey.info/cassandra-aggregates-min-max-avg-group.html" rel="nofollow noreferrer">http://www.batey.info/cassandra-aggregates-min-max-avg-group.html</a></p>
  
  <p>And I have the following function and aggregate</p>
  
  <pre><code>CREATE FUNCTION state_group_and_total( state map&lt;text, int&gt;, type text, amount int )
  CALLED ON NULL INPUT
  RETURNS map&lt;text, int&gt;
  LANGUAGE java AS '
    Integer count = (Integer) state.get(type);
    if (count == null)
      count = amount;
    else
      count = count + amount;
    state.put(type, count);
    return state; ' ;
  
  
  CREATE OR REPLACE AGGREGATE group_and_total(text, int) 
  SFUNC state_group_and_total 
  STYPE map&lt;text, int&gt; 
  INITCOND {};
  </code></pre>
  
  <p>But when I run the following command <code>select group_and_total(name,count) from ascore;</code> I get the error <code>Failed to format value OrderedMapSerializedKey([(u'gleydson', 4)]) : 'NoneType' object has no attribute 'sub_types'</code></p>
  
  <p>My schema is</p>
  
  <pre><code>CREATE TABLE ascore (
    name text,
    count int,
    id text,
    PRIMARY KEY(id)
  )
  </code></pre>