Cassandra Composite Columns - How are CompositeTypes selected?

I am trying to understand the type used when creating composite columns.

I use CQL3 (via cqlsh) to create a CF, and then the CLI to issue a description command. Types in columns sorted by: ... CompositeType (Type1, Type2, ...) are not the ones I expect.

I am using Cassandra 1.1.6.

CREATE TABLE CompKeyTest1 (
             KeyA int,
             KeyB int,
             KeyC int,
             MyData varchar,
             PRIMARY KEY (KeyA, KeyB, KeyC)
           );

Returned CompositeType -

CompositeType(Int32,Int32,UTF8)

Should it be (Int32, Int32, Int32)?

CREATE TABLE CompKeyTest2 (
             KeyA int,
             KeyB varchar,
             KeyC int,
             MyData varchar,
             PRIMARY KEY (KeyA, KeyB, KeyC)
           );

Returned CompositeType -

CompositeType(UTF8,Int32,UTF8)

Why is this not the same as the types used to define the table? I probably missed something basic in type assignment ...

Thank!

+3
source share
1 answer

The complex column name consists of the values ​​of the primary keys 2 ... n and the name of the saved column of the non-primary key.

(, 5 , , , .)

, KeyB, KeyC ("MyData", ). CompositeTypes.

(btw, , ( Cassandra ). .)

+4

All Articles