incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Create CF with composite column through CQL 3
Date Wed, 31 Oct 2012 17:36:04 GMT
You didn't do anything wrong, it's how CQL3 works. I suggest having a
look at http://www.datastax.com/dev/blog/thrift-to-cql3. Especially
the section called "Non compact tables" might hopefully explains more.

--
Sylvain

On Wed, Oct 31, 2012 at 6:14 PM, Wei Zhu <wz1975@yahoo.com> wrote:
> I try to use CQL3 to create CF with composite columns,
>
>  CREATE TABLE Friends (
>          ...     user_id bigint,
>          ...     friend_id bigint,
>          ...     status int,
>          ...     source int,
>          ...     created timestamp,
>          ...     lastupdated timestamp,
>          ...     PRIMARY KEY (user_id, friend_id, status, source)
>          ... );
>
>
> When I check it with cli, the composite type is a bit odd, why it's defined
> as Long, Int32, Int32, UTF8, is it supposed to be Long, Long, Int32, Int32?
> Did
> I do something wrong?
>
>  describe friends;
>     ColumnFamily: friends
>       Key Validation Class: org.apache.cassandra.db.marshal.LongType
>       Default column value validator:
> org.apache.cassandra.db.marshal.UTF8Type
>       Columns sorted by: org.apache.cassandra.db.marshal.CompositeType(
> org.apache.cassandra.db.marshal.LongType,
> org.apache.cassandra.db.marshal.Int32Type,
> org.apache.cassandra.db.marshal.Int32Type,
> org.apache.cassandra.db.marshal.UTF8Type)
>       GC grace seconds: 864000
>       Compaction min/max thresholds: 4/32
>       Read repair chance: 0.1
>       DC Local Read repair chance: 0.0
>       Replicate on write: true
>       Caching: KEYS_ONLY
>       Bloom Filter FP chance: default
>       Built indexes: []
>       Compaction Strategy:
> org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
>       Compression Options:
>         sstable_compression:
> org.apache.cassandra.io.compress.SnappyCompressor
>
> Thanks.
> -Wei

Mime
View raw message