> But a error is thrown saying "can not parse name as hex bytes". If the comparator is Bytes then the column names need to be a hex string.
The easiest thing to do is create a CF where the comparator is UTF8Type so you can use string column names. > just that the UTF8Type needs to be validated before storing the data into > database and BytesType need not to? It takes *very* little additional effort. Cheers ----------------- Aaron Morton Freelance Cassandra Consultant New Zealand @aaronmorton http://www.thelastpickle.com On 23/03/2013, at 12:10 AM, Xu Renjie <xrjxrjxrj...@gmail.com> wrote: > Sorry, continued: > I have created a column family User with no parameters specified, just > create column family User. > Then I checked that the default comparator is BytesType. > > Then I want to create secondary index on one column like below: > update column family User with column_metadata=[{column_name:name, > validation_class:BytesType, index_type:0}]; > But a error is thrown saying "can not parse name as hex bytes". > > So I wonder under this situation, is it possible to create index using > cassandra-cli, if possible, how? > > Furthermore, I wonder what's the difference of type BytesType and UTF8Type > and other types underlying. > If I store string 'name' into database, do they have the same internal bytes > stored in Cassandra, > just that the UTF8Type needs to be validated before storing the data into > database and BytesType need not to? > > > On Fri, Mar 22, 2013 at 7:00 PM, Xu Renjie <xrjxrjxrj...@gmail.com> wrote: > Hello, guys: > I am new to Cassandra. I am currently using cassandra-cli(version 1.1.6). >