You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by hlqv <hl...@gmail.com> on 2014/08/12 19:13:31 UTC

Number of columns per row for composite columns?

Hi everyone,
I'm confused with number of columns in a row of Cassandra, as far as I know
there is 2 billions columns per row. Like that if I have a composite column
name in each row, for ex: (timestamp, userid), then number of columns per
row is the number of distinct 'timestamp' or each distinct 'timestamp,
userid' is a column?

RE: Number of columns per row for composite columns?

Posted by Mohammed Guller <mo...@glassbeam.com>.
4


Mohammed

From: hlqv [mailto:hlqvuong@gmail.com]
Sent: Tuesday, August 12, 2014 11:44 PM
To: user@cassandra.apache.org
Subject: Re: Number of columns per row for composite columns?

For more specifically, I declared a column family

create column family Column_Family
        with key_validation_class = UTF8Type
        and comparator = 'CompositeType(LongType,UTF8Type)'
        and default_validation_class = UTF8Type;
Number of columns will depend on only first column name in composite column or both.
For example,
With row key  = 1, I have data
1 | 20140813, user1 | value1
1 | 20140813, user2 | value2
1 | 20140814, user1 | value3
1 | 20140814, user2 | value4
(1: rowkey, "20140813, user1": composite column, "value1" : the value of column)

So the number of columns of row key 1 will be 2 or 4? (2 for 20140813 and 20140814, 4 for each distinct composite column)
Thank you so much

On 13 August 2014 03:18, Jack Krupansky <ja...@basetechnology.com>> wrote:
Your question is a little too tangled for me... Are you asking about rows in a partition (some people call that a “storage row”) or columns per row? The latter is simply the number of columns that you have declared in your table.

The total number of columns – or more properly, “cells” – in a partition would be the number of rows you have inserted in that partition times the number of columns you have declared in the table.

If you need to review the terminology:
http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows

-- Jack Krupansky

From: hlqv<ma...@gmail.com>
Sent: Tuesday, August 12, 2014 1:13 PM
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Number of columns per row for composite columns?

Hi everyone,
I'm confused with number of columns in a row of Cassandra, as far as I know there is 2 billions columns per row. Like that if I have a composite column name in each row, for ex: (timestamp, userid), then number of columns per row is the number of distinct 'timestamp' or each distinct 'timestamp, userid' is a column?


Re: Number of columns per row for composite columns?

Posted by DuyHai Doan <do...@gmail.com>.
In your example it will be 4 physical columns


On Wed, Aug 13, 2014 at 8:43 AM, hlqv <hl...@gmail.com> wrote:

> For more specifically, I declared a column family
>
> create column family Column_Family
>         with key_validation_class = UTF8Type
>         and comparator = 'CompositeType(LongType,UTF8Type)'
>         and default_validation_class = UTF8Type;
>
> Number of columns will depend on only first column name in composite
> column or both.
> For example,
> With row key  = 1, I have data
> 1 | 20140813, user1 | value1
> 1 | 20140813, user2 | value2
> 1 | 20140814, user1 | value3
> 1 | 20140814, user2 | value4
> (1: rowkey, "20140813, user1": composite column, "value1" : the value of
> column)
>
> So the number of columns of row key 1 will be 2 or 4? (2 for 20140813 and
> 20140814, 4 for each distinct composite column)
>
> Thank you so much
>
>
> On 13 August 2014 03:18, Jack Krupansky <ja...@basetechnology.com> wrote:
>
>>   Your question is a little too tangled for me... Are you asking about
>> rows in a partition (some people call that a “storage row”) or columns per
>> row? The latter is simply the number of columns that you have declared in
>> your table.
>>
>> The total number of columns – or more properly, “cells” – in a partition
>> would be the number of rows you have inserted in that partition times the
>> number of columns you have declared in the table.
>>
>> If you need to review the terminology:
>>
>> http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows
>>
>> -- Jack Krupansky
>>
>>  *From:* hlqv <hl...@gmail.com>
>> *Sent:* Tuesday, August 12, 2014 1:13 PM
>> *To:* user@cassandra.apache.org
>> *Subject:* Number of columns per row for composite columns?
>>
>>  Hi everyone,
>> I'm confused with number of columns in a row of Cassandra, as far as I
>> know there is 2 billions columns per row. Like that if I have a composite
>> column name in each row, for ex: (timestamp, userid), then number of
>> columns per row is the number of distinct 'timestamp' or each distinct
>> 'timestamp, userid' is a column?
>>
>
>

Re: Number of columns per row for composite columns?

Posted by hlqv <hl...@gmail.com>.
For more specifically, I declared a column family

create column family Column_Family
        with key_validation_class = UTF8Type
        and comparator = 'CompositeType(LongType,UTF8Type)'
        and default_validation_class = UTF8Type;

Number of columns will depend on only first column name in composite column
or both.
For example,
With row key  = 1, I have data
1 | 20140813, user1 | value1
1 | 20140813, user2 | value2
1 | 20140814, user1 | value3
1 | 20140814, user2 | value4
(1: rowkey, "20140813, user1": composite column, "value1" : the value of
column)

So the number of columns of row key 1 will be 2 or 4? (2 for 20140813 and
20140814, 4 for each distinct composite column)

Thank you so much


On 13 August 2014 03:18, Jack Krupansky <ja...@basetechnology.com> wrote:

>   Your question is a little too tangled for me... Are you asking about
> rows in a partition (some people call that a “storage row”) or columns per
> row? The latter is simply the number of columns that you have declared in
> your table.
>
> The total number of columns – or more properly, “cells” – in a partition
> would be the number of rows you have inserted in that partition times the
> number of columns you have declared in the table.
>
> If you need to review the terminology:
> http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows
>
> -- Jack Krupansky
>
>  *From:* hlqv <hl...@gmail.com>
> *Sent:* Tuesday, August 12, 2014 1:13 PM
> *To:* user@cassandra.apache.org
> *Subject:* Number of columns per row for composite columns?
>
>  Hi everyone,
> I'm confused with number of columns in a row of Cassandra, as far as I
> know there is 2 billions columns per row. Like that if I have a composite
> column name in each row, for ex: (timestamp, userid), then number of
> columns per row is the number of distinct 'timestamp' or each distinct
> 'timestamp, userid' is a column?
>

Re: Number of columns per row for composite columns?

Posted by Jack Krupansky <ja...@basetechnology.com>.
Your question is a little too tangled for me... Are you asking about rows in a partition (some people call that a “storage row”) or columns per row? The latter is simply the number of columns that you have declared in your table.

The total number of columns – or more properly, “cells” – in a partition would be the number of rows you have inserted in that partition times the number of columns you have declared in the table.

If you need to review the terminology:
http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows

-- Jack Krupansky

From: hlqv 
Sent: Tuesday, August 12, 2014 1:13 PM
To: user@cassandra.apache.org 
Subject: Number of columns per row for composite columns?

Hi everyone,
I'm confused with number of columns in a row of Cassandra, as far as I know there is 2 billions columns per row. Like that if I have a composite column name in each row, for ex: (timestamp, userid), then number of columns per row is the number of distinct 'timestamp' or each distinct 'timestamp, userid' is a column?