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: Using composite column names in the CLI
Date Tue, 17 May 2011 09:54:50 GMT
> (I presume there is some way of representing ":", like "\:"?)

Well no, not yet, but we'll try to figure something I guess (we'll have the
problem with CASSANDRA-2474 I think so we'll probably use the same
solution).

But let's keep in mind this is unreleased code at this point. And let me
also add that it's just a cli limitation (actually of the
AbstractCompositeType.fromString() method).

--
Sylvain

> On Tue, May 17, 2011 at 11:44 AM, Sylvain Lebresne <sylvain@datastax.com>
> wrote:
>>
>> Provided you're working on a branch that has CASSANDRA-2231 applied
>> (that's
>> either the cassandra-0.8.1 branch or trunk), this work 'out of the box':
>>
>> The setup will look like:
>> [default@unknown] create keyspace test;
>> [default@unknown] use test;
>> [default@test] create column family testCF with
>> comparator='CompositeType(AsciiType, IntegerType(reversed=true),
>> IntegerType)' and default_validation_class=AsciiType;
>>
>> Then:
>> [default@test] set testCF[a]['foo:24:24'] = 'v1';
>> Value inserted.
>> [default@test] set testCF[a]['foo:42:24'] = 'v2';
>> Value inserted.
>> [default@test] set testCF[a]['foobar:42:24'] = 'v3';
>> Value inserted.
>> [default@test] set testCF[a]['boobar:42:24'] = 'v4';
>> Value inserted.
>> [default@test] set testCF[a]['boobar:42:42'] = 'v5';
>> Value inserted.
>> [default@test] get testCF[a];
>> => (column=boobar:42:24, value=v4, timestamp=1305621115813000)
>> => (column=boobar:42:42, value=v5, timestamp=1305621125563000)
>> => (column=foo:42:24, value=v2, timestamp=1305621096473000)
>> => (column=foo:24:24, value=v1, timestamp=1305621085548000)
>> => (column=foobar:42:24, value=v3, timestamp=1305621110813000)
>> Returned 5 results.
>>
>> --
>> Sylvain
>>
>> On Tue, May 17, 2011 at 9:20 AM, David Boxenhorn <david@taotown.com>
>> wrote:
>> > This is what I'm talking about
>> >
>> > https://issues.apache.org/jira/browse/CASSANDRA-2231
>> >
>> > The on-disk format is
>> >
>> > <(short)length><constituent><end byte =
>> > 0><(short)length><constituent><end
>> > byte = 0>...
>> >
>> > I would like to be able to input these kinds of keys into the CLI,
>> > something
>> > like
>> >
>> > set cf[key]['constituent1':'constituent2':'constituent3'] = val
>> >
>> >
>> > On Tue, May 17, 2011 at 2:15 AM, Sameer Farooqui
>> > <cassandralabs@gmail.com>
>> > wrote:
>> >>
>> >> Cassandra wouldn't know that the column name is composite of two
>> >> different
>> >> things. So you could just request the column names and values for a
>> >> specific
>> >> key like this and then just look at the column names that get returned:
>> >> [default@MyKeyspace] get DemoCF[ascii('key_42')];
>> >> => (column=CA_SanJose, value=50, timestamp=1305236885112000)
>> >> => (column=CA_PaloAlto, value=49, timestamp=1305236885192000)
>> >> => (column=FL_Orlando, value=45, timestamp=1305236885280000)
>> >> => (column=NY_NYC, value=40, timestamp=1305236885361000)
>> >>
>> >> And I'm not sure what you mean by inputting composite column names. You
>> >> just input them like any other column name:
>> >> [default@MyKeyspace] set DemoCF['key_42']['CA_SanJose']='51';
>> >> Value inserted.
>> >>
>> >>
>> >>
>> >>
>> >> On Mon, May 16, 2011 at 2:34 PM, Aaron Morton <aaron@thelastpickle.com>
>> >> wrote:
>> >>>
>> >>> What do you mean by composite column names?
>> >>>
>> >>> Do the data type functions supported by get and set help? Or the
>> >>> assume
>> >>> statement?
>> >>>
>> >>> Aaron
>> >>> On 17/05/2011, at 3:21 AM, David Boxenhorn <david@taotown.com>
wrote:
>> >>>
>> >>> > Is there a way to view composite column names in the CLI?
>> >>> >
>> >>> > Is there a way to input them (i.e. in the set command)?
>> >>> >
>> >>
>> >
>> >
>
>

Mime
View raw message