You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Vivek Mishra <mi...@gmail.com> on 2012/10/16 11:57:34 UTC

Missing non composite column

Hi,
I am facing a strange issue with CQL and cassandra-cli. I have a created a
keyspace from cassandra-cli as :
 a) create keyspace bigdata;

Then connected via cql3sh and created a column family with compound primary
key column as:

CREATE TABLE altercations_utf8 (
       instigator text,
       started_at text,
       ships_destroyed text,
       energy_used text,
       alliance_involvement text,
       PRIMARY KEY (instigator,started_at,ships_destroyed));
/
Then inserted a record:
 INSERT INTO altercations_utf8 (instigator, started_at, ships_destroyed,
                             energy_used, alliance_involvement)
                     VALUES ('Jayne Cobb', '2012-07-24', '2', '4.6',
'false');
/

cql3 command prompt shows me:

cqlsh:bigdata> select * from altercations_utf8;
 instigator | started_at | ships_destroyed | alliance_involvement |
energy_used
------------+------------+-----------------+----------------------+-------------
 Jayne Cobb | 2012-07-24 |               2 |                false |
4.6


But when i try to connect via cassandra-cli and try to list number of rows
by issuning command:

[default@unknown] use bigdata;
Authenticated to keyspace: bigdata
[default@bigdata] list altercations_utf8;
Using default limit of 100
Using default column limit of 100
-------------------
RowKey: Jayne Cobb
=> (column=2012-07-24:2:alliance_involvement, value=false,
timestamp=1350381005020000)
=> (column=2012-07-24:2:energy_used, value=4.6, timestamp=1350381005020001)


Not sure, why is it not getting non-composite column(e.g. ships_destroyed
in this case).

I tried this with cassandra 1.1.5 release. Will it be an issue, even if i
try to find this via Thrift API?

-Vivek

Re: Missing non composite column

Posted by Vivek Mishra <mi...@gmail.com>.
Anybody in group got into such issues?

-Vivek

On Fri, Oct 19, 2012 at 3:28 PM, Vivek Mishra <mi...@gmail.com> wrote:

> Ok. I did assume the same, here is what i have tried to fetch composite
> columns via thrift and CQL query as well!
>
> Not sure why thrift API is returning me column name as empty!  (Tried with
> Cassandra 1.1.5)
>
> Here is the program:
>
>
> /*******************************************************************************
>  * * Copyright 2012 Impetus Infotech.
>  *  *
>  *  * Licensed under the Apache License, Version 2.0 (the "License");
>  *  * you may not use this file except in compliance with the License.
>  *  * You may obtain a copy of the License at
>  *  *
>  *  *      http://www.apache.org/licenses/LICENSE-2.0
>  *  *
>  *  * Unless required by applicable law or agreed to in writing, software
>  *  * distributed under the License is distributed on an "AS IS" BASIS,
>  *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
>  *  * See the License for the specific language governing permissions and
>  *  * limitations under the License.
>
>  ******************************************************************************/
> package com.impetus.client.cassandra.thrift;
>
> import java.nio.ByteBuffer;
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.LinkedHashMap;
> import java.util.List;
>
> import org.apache.cassandra.db.marshal.AbstractType;
> import org.apache.cassandra.db.marshal.CompositeType;
> import org.apache.cassandra.db.marshal.CompositeType.Builder;
> import org.apache.cassandra.db.marshal.UTF8Type;
> import org.apache.cassandra.locator.SimpleStrategy;
> import org.apache.cassandra.thrift.Cassandra;
> import org.apache.cassandra.thrift.CfDef;
> import org.apache.cassandra.thrift.Column;
> import org.apache.cassandra.thrift.ColumnOrSuperColumn;
> import org.apache.cassandra.thrift.ColumnParent;
> import org.apache.cassandra.thrift.Compression;
> import org.apache.cassandra.thrift.ConsistencyLevel;
> import org.apache.cassandra.thrift.CqlResult;
> import org.apache.cassandra.thrift.CqlRow;
> import org.apache.cassandra.thrift.KsDef;
> import org.apache.cassandra.thrift.SlicePredicate;
> import org.apache.cassandra.thrift.SliceRange;
> import org.apache.cassandra.thrift.TBinaryProtocol;
> import org.apache.thrift.transport.TFramedTransport;
> import org.apache.thrift.transport.TSocket;
> import org.scale7.cassandra.pelops.Bytes;
>
> /**
>  * @author vivek.mishra
>  *
>  */
> public class CompositeTypeRunner
> {
>     public static void main(String[] args) throws Exception {
>
>         TSocket socket = new TSocket("localhost", 9160);
>         TFramedTransport transport = new TFramedTransport(socket);
>
>         Cassandra.Client client = new Cassandra.Client(new
> TBinaryProtocol(transport));
>         transport.open();
>         client.set_cql_version("3.0.0");
>         List<CfDef> cfDefs = new ArrayList<CfDef>();
>
>         /*  CfDef cfDef = new CfDef();
>         cfDef.setName("test");
>         cfDef.keyspace = "bigdata";
>         cfDef.setComparator_type("UTF8Type");
>         cfDef.setDefault_validation_class("UTF8Type");
> //        cfDef.setKey_validation_class("UTF8Type");
>
>         cfDefs.add(cfDef);*/
>
>
>        KsDef ksDef = new KsDef("bigdata", SimpleStrategy.class.getName(),
> cfDefs);
>
>         if (ksDef.strategy_options == null)
>         {
>             ksDef.strategy_options = new LinkedHashMap<String, String>();
>         }
>
>         ksDef.strategy_options.put("replication_factor", "1");
>         client.system_add_keyspace(ksDef);
>         client.set_keyspace("bigdata");
>
>         String cql_Query = "create columnfamily test1 (name text, age
> text, address text, PRIMARY KEY(name,age))";
>
>         client.execute_cql_query(ByteBuffer.wrap(("USE
> bigdata").getBytes("UTF-8")) , Compression.NONE);
>
>
> client.execute_cql_query(ByteBuffer.wrap((cql_Query).getBytes("UTF-8")) ,
> Compression.NONE);
>
>         /*ColumnParent parent = new ColumnParent("test1");
>
>         List<AbstractType<?>> keyTypes = new ArrayList<AbstractType<?>>();
>         keyTypes.add(UTF8Type.instance);
>         keyTypes.add(UTF8Type.instance);
>         CompositeType compositeKey = CompositeType.getInstance(keyTypes);
>
>         Builder builder = new Builder(compositeKey);
>         builder.add(ByteBuffer.wrap("1".getBytes()));
>         builder.add(ByteBuffer.wrap("2".getBytes()));
>         ByteBuffer rowid = builder.build();
>
>         Column column = new Column();
>         column.setName("value".getBytes());
>         column.setValue("aaa".getBytes());
>         column.setTimestamp(System.currentTimeMillis());
>
>         client.insert(rowid, parent, column, ConsistencyLevel.ONE);*/
>
>         ColumnParent parent = new ColumnParent("test1");
>
>         List<AbstractType<?>> keyTypes = new ArrayList<AbstractType<?>>();
>         keyTypes.add(UTF8Type.instance);
>         keyTypes.add(UTF8Type.instance);
>         CompositeType compositeKey = CompositeType.getInstance(keyTypes);
>
>         Builder builder = new Builder(compositeKey);
>         builder.add(ByteBuffer.wrap("3".getBytes()));
>         builder.add(ByteBuffer.wrap("address".getBytes()));
>         ByteBuffer columnName = builder.build();
>
>
>         Column column = new Column();
>         column.setName(columnName);
>         column.setValue("4".getBytes());
>         column.setTimestamp(System.currentTimeMillis());
>
>         client.insert(ByteBuffer.wrap("1".getBytes()), parent, column,
> ConsistencyLevel.ONE);
>
>
>         SlicePredicate slicePredicate = new SlicePredicate();
>         slicePredicate.setSlice_range(new
> SliceRange(Bytes.EMPTY.getBytes(), Bytes.EMPTY.getBytes(), true, 10000));
>         List<ColumnOrSuperColumn> columns =
> client.get_slice(ByteBuffer.wrap("1".getBytes()), parent, slicePredicate,
> ConsistencyLevel.ONE);
>
>         for(ColumnOrSuperColumn col : columns)
>         {
>             if(col.column != null)
>             {
>                 System.out.println(new String(col.getColumn().getName()));
>   // Printing "EMPTY" String!
>                 System.out.println(new String(col.getColumn().getValue()));
>             } else if(col.super_column != null)
>             {
>
>             } else if(col.counter_column != null)
>             {
>
>             } else if(col.counter_super_column != null)
>             {
>
>             }
>         }
>
>         // On cql select query.
>
>         String selectQuery = "Select * from test1";
>         CqlResult result =
> client.execute_cql_query(ByteBuffer.wrap(selectQuery.getBytes("UTF-8")),
> Compression.NONE);
>         Iterator<CqlRow> rows = result.getRowsIterator();
>         while(rows.hasNext())
>         {
>             CqlRow row = rows.next();
>             List<Column> cols =  row.getColumns();
>             for(Column c : cols)
>             {
>                 System.out.println(new String(c.getName()) + "=>" + new
> String(c.getValue()));
>
>             }
>         }
>     }
> }
>
>
> Why there is a difference with data set return by CQL and via "slice
> query"? I know about "interpolation" but wondering what is the best way to
> interact with cassandra in near future?
>
>
> -Vivek
>
> On Thu, Oct 18, 2012 at 4:28 PM, aaron morton <aa...@thelastpickle.com>wrote:
>
>> Yes, i understand that. Reason why i am asking is, with this i need to
>> split
>> them to get actual column name using ":" as a seperator.
>>
>> The ":" is a artefact of the cassandra-cli, nothing something you will
>> have to deal with via the thrift API. Internally we do not store the values
>> with ":" separators.
>>
>> Any idiomatic API will take care of parsing the raw wire format, see the
>> pycassa example here...
>>
>> http://pycassa.github.com/pycassa/assorted/composite_types.html
>>
>> Cheers
>>
>>   -----------------
>> Aaron Morton
>> Freelance Developer
>> @aaronmorton
>> http://www.thelastpickle.com
>>
>> On 18/10/2012, at 2:58 AM, Sylvain Lebresne <sy...@datastax.com> wrote:
>>
>> Yes, i understand that. Reason why i am asking is, with this i need to
>> split
>> them to get actual column name using ":" as a seperator.
>> Though i did not try it yet, but wondering if column name is like
>> "alliance:movement", then how do it compute it?
>>
>>
>> You've lost me, sorry.
>>
>> --
>> Sylvain
>>
>>
>>
>> On Wed, Oct 17, 2012 at 1:04 PM, Sylvain Lebresne <sy...@datastax.com>
>> wrote:
>>
>>
>> On Wed, Oct 17, 2012 at 3:17 AM, Vivek Mishra <mi...@gmail.com>
>> wrote:
>>
>> column name will be "2012-07-24:2:alliance_involvement" or
>> "alliance_involvement"?
>>
>>
>> The former. Though let's clarify that
>> "2012-07-24:2:alliance_involvement" is the string representation of a
>> composite name (i.e. one compatible with CompositeType) for display by
>> the cli. What you will get is a composite containing 3 components, the
>> first will be the string '2012-07-24', the second one will be the int
>> 2 and the last one will be the string 'alliance_involvement'.
>>
>> --
>> Sylvain
>>
>>
>> -Vivek
>>
>> On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne
>> <sy...@datastax.com>
>> wrote:
>>
>>
>> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
>> wrote:
>>
>> Thanks Sylvain. I missed it. If i try to access these via thrift API,
>> what
>> will be the column names?
>>
>>
>> I'm not sure I understand the question. The cli output is pretty much
>> what you get via the thrift API.
>>
>> --
>> Sylvain
>>
>>
>>
>>
>>
>>
>>
>

Re: Missing non composite column

Posted by Vivek Mishra <mi...@gmail.com>.
Ok. I did assume the same, here is what i have tried to fetch composite
columns via thrift and CQL query as well!

Not sure why thrift API is returning me column name as empty!  (Tried with
Cassandra 1.1.5)

Here is the program:

/*******************************************************************************
 * * Copyright 2012 Impetus Infotech.
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  * You may obtain a copy of the License at
 *  *
 *  *      http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 ******************************************************************************/
package com.impetus.client.cassandra.thrift;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;

import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.CompositeType;
import org.apache.cassandra.db.marshal.CompositeType.Builder;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.locator.SimpleStrategy;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.CfDef;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.ColumnParent;
import org.apache.cassandra.thrift.Compression;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.thrift.CqlResult;
import org.apache.cassandra.thrift.CqlRow;
import org.apache.cassandra.thrift.KsDef;
import org.apache.cassandra.thrift.SlicePredicate;
import org.apache.cassandra.thrift.SliceRange;
import org.apache.cassandra.thrift.TBinaryProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.scale7.cassandra.pelops.Bytes;

/**
 * @author vivek.mishra
 *
 */
public class CompositeTypeRunner
{
    public static void main(String[] args) throws Exception {

        TSocket socket = new TSocket("localhost", 9160);
        TFramedTransport transport = new TFramedTransport(socket);

        Cassandra.Client client = new Cassandra.Client(new
TBinaryProtocol(transport));
        transport.open();
        client.set_cql_version("3.0.0");
        List<CfDef> cfDefs = new ArrayList<CfDef>();

        /*  CfDef cfDef = new CfDef();
        cfDef.setName("test");
        cfDef.keyspace = "bigdata";
        cfDef.setComparator_type("UTF8Type");
        cfDef.setDefault_validation_class("UTF8Type");
//        cfDef.setKey_validation_class("UTF8Type");

        cfDefs.add(cfDef);*/


       KsDef ksDef = new KsDef("bigdata", SimpleStrategy.class.getName(),
cfDefs);

        if (ksDef.strategy_options == null)
        {
            ksDef.strategy_options = new LinkedHashMap<String, String>();
        }

        ksDef.strategy_options.put("replication_factor", "1");
        client.system_add_keyspace(ksDef);
        client.set_keyspace("bigdata");

        String cql_Query = "create columnfamily test1 (name text, age text,
address text, PRIMARY KEY(name,age))";

        client.execute_cql_query(ByteBuffer.wrap(("USE
bigdata").getBytes("UTF-8")) , Compression.NONE);


client.execute_cql_query(ByteBuffer.wrap((cql_Query).getBytes("UTF-8")) ,
Compression.NONE);

        /*ColumnParent parent = new ColumnParent("test1");

        List<AbstractType<?>> keyTypes = new ArrayList<AbstractType<?>>();
        keyTypes.add(UTF8Type.instance);
        keyTypes.add(UTF8Type.instance);
        CompositeType compositeKey = CompositeType.getInstance(keyTypes);

        Builder builder = new Builder(compositeKey);
        builder.add(ByteBuffer.wrap("1".getBytes()));
        builder.add(ByteBuffer.wrap("2".getBytes()));
        ByteBuffer rowid = builder.build();

        Column column = new Column();
        column.setName("value".getBytes());
        column.setValue("aaa".getBytes());
        column.setTimestamp(System.currentTimeMillis());

        client.insert(rowid, parent, column, ConsistencyLevel.ONE);*/

        ColumnParent parent = new ColumnParent("test1");

        List<AbstractType<?>> keyTypes = new ArrayList<AbstractType<?>>();
        keyTypes.add(UTF8Type.instance);
        keyTypes.add(UTF8Type.instance);
        CompositeType compositeKey = CompositeType.getInstance(keyTypes);

        Builder builder = new Builder(compositeKey);
        builder.add(ByteBuffer.wrap("3".getBytes()));
        builder.add(ByteBuffer.wrap("address".getBytes()));
        ByteBuffer columnName = builder.build();


        Column column = new Column();
        column.setName(columnName);
        column.setValue("4".getBytes());
        column.setTimestamp(System.currentTimeMillis());

        client.insert(ByteBuffer.wrap("1".getBytes()), parent, column,
ConsistencyLevel.ONE);


        SlicePredicate slicePredicate = new SlicePredicate();
        slicePredicate.setSlice_range(new
SliceRange(Bytes.EMPTY.getBytes(), Bytes.EMPTY.getBytes(), true, 10000));
        List<ColumnOrSuperColumn> columns =
client.get_slice(ByteBuffer.wrap("1".getBytes()), parent, slicePredicate,
ConsistencyLevel.ONE);

        for(ColumnOrSuperColumn col : columns)
        {
            if(col.column != null)
            {
                System.out.println(new String(col.getColumn().getName()));
  // Printing "EMPTY" String!
                System.out.println(new String(col.getColumn().getValue()));
            } else if(col.super_column != null)
            {

            } else if(col.counter_column != null)
            {

            } else if(col.counter_super_column != null)
            {

            }
        }

        // On cql select query.

        String selectQuery = "Select * from test1";
        CqlResult result =
client.execute_cql_query(ByteBuffer.wrap(selectQuery.getBytes("UTF-8")),
Compression.NONE);
        Iterator<CqlRow> rows = result.getRowsIterator();
        while(rows.hasNext())
        {
            CqlRow row = rows.next();
            List<Column> cols =  row.getColumns();
            for(Column c : cols)
            {
                System.out.println(new String(c.getName()) + "=>" + new
String(c.getValue()));

            }
        }
    }
}


Why there is a difference with data set return by CQL and via "slice
query"? I know about "interpolation" but wondering what is the best way to
interact with cassandra in near future?


-Vivek

On Thu, Oct 18, 2012 at 4:28 PM, aaron morton <aa...@thelastpickle.com>wrote:

> Yes, i understand that. Reason why i am asking is, with this i need to
> split
> them to get actual column name using ":" as a seperator.
>
> The ":" is a artefact of the cassandra-cli, nothing something you will
> have to deal with via the thrift API. Internally we do not store the values
> with ":" separators.
>
> Any idiomatic API will take care of parsing the raw wire format, see the
> pycassa example here...
>
> http://pycassa.github.com/pycassa/assorted/composite_types.html
>
> Cheers
>
> -----------------
> Aaron Morton
> Freelance Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 18/10/2012, at 2:58 AM, Sylvain Lebresne <sy...@datastax.com> wrote:
>
> Yes, i understand that. Reason why i am asking is, with this i need to
> split
> them to get actual column name using ":" as a seperator.
> Though i did not try it yet, but wondering if column name is like
> "alliance:movement", then how do it compute it?
>
>
> You've lost me, sorry.
>
> --
> Sylvain
>
>
>
> On Wed, Oct 17, 2012 at 1:04 PM, Sylvain Lebresne <sy...@datastax.com>
> wrote:
>
>
> On Wed, Oct 17, 2012 at 3:17 AM, Vivek Mishra <mi...@gmail.com>
> wrote:
>
> column name will be "2012-07-24:2:alliance_involvement" or
> "alliance_involvement"?
>
>
> The former. Though let's clarify that
> "2012-07-24:2:alliance_involvement" is the string representation of a
> composite name (i.e. one compatible with CompositeType) for display by
> the cli. What you will get is a composite containing 3 components, the
> first will be the string '2012-07-24', the second one will be the int
> 2 and the last one will be the string 'alliance_involvement'.
>
> --
> Sylvain
>
>
> -Vivek
>
> On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne
> <sy...@datastax.com>
> wrote:
>
>
> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
> wrote:
>
> Thanks Sylvain. I missed it. If i try to access these via thrift API,
> what
> will be the column names?
>
>
> I'm not sure I understand the question. The cli output is pretty much
> what you get via the thrift API.
>
> --
> Sylvain
>
>
>
>
>
>
>

Re: Missing non composite column

Posted by aaron morton <aa...@thelastpickle.com>.
>> Yes, i understand that. Reason why i am asking is, with this i need to split
>> them to get actual column name using ":" as a seperator.
The ":" is a artefact of the cassandra-cli, nothing something you will have to deal with via the thrift API. Internally we do not store the values with ":" separators. 

Any idiomatic API will take care of parsing the raw wire format, see the pycassa example here...

http://pycassa.github.com/pycassa/assorted/composite_types.html

Cheers

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 18/10/2012, at 2:58 AM, Sylvain Lebresne <sy...@datastax.com> wrote:

>> Yes, i understand that. Reason why i am asking is, with this i need to split
>> them to get actual column name using ":" as a seperator.
>> Though i did not try it yet, but wondering if column name is like
>> "alliance:movement", then how do it compute it?
> 
> You've lost me, sorry.
> 
> --
> Sylvain
> 
>> 
>> 
>> On Wed, Oct 17, 2012 at 1:04 PM, Sylvain Lebresne <sy...@datastax.com>
>> wrote:
>>> 
>>> On Wed, Oct 17, 2012 at 3:17 AM, Vivek Mishra <mi...@gmail.com>
>>> wrote:
>>>> column name will be "2012-07-24:2:alliance_involvement" or
>>>> "alliance_involvement"?
>>> 
>>> The former. Though let's clarify that
>>> "2012-07-24:2:alliance_involvement" is the string representation of a
>>> composite name (i.e. one compatible with CompositeType) for display by
>>> the cli. What you will get is a composite containing 3 components, the
>>> first will be the string '2012-07-24', the second one will be the int
>>> 2 and the last one will be the string 'alliance_involvement'.
>>> 
>>> --
>>> Sylvain
>>> 
>>>> 
>>>> -Vivek
>>>> 
>>>> On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne
>>>> <sy...@datastax.com>
>>>> wrote:
>>>>> 
>>>>> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
>>>>> wrote:
>>>>>> Thanks Sylvain. I missed it. If i try to access these via thrift API,
>>>>>> what
>>>>>> will be the column names?
>>>>> 
>>>>> I'm not sure I understand the question. The cli output is pretty much
>>>>> what you get via the thrift API.
>>>>> 
>>>>> --
>>>>> Sylvain
>>>> 
>>>> 
>> 
>> 


Re: Missing non composite column

Posted by Sylvain Lebresne <sy...@datastax.com>.
> Yes, i understand that. Reason why i am asking is, with this i need to split
> them to get actual column name using ":" as a seperator.
> Though i did not try it yet, but wondering if column name is like
> "alliance:movement", then how do it compute it?

You've lost me, sorry.

--
Sylvain

>
>
> On Wed, Oct 17, 2012 at 1:04 PM, Sylvain Lebresne <sy...@datastax.com>
> wrote:
>>
>> On Wed, Oct 17, 2012 at 3:17 AM, Vivek Mishra <mi...@gmail.com>
>> wrote:
>> > column name will be "2012-07-24:2:alliance_involvement" or
>> > "alliance_involvement"?
>>
>> The former. Though let's clarify that
>> "2012-07-24:2:alliance_involvement" is the string representation of a
>> composite name (i.e. one compatible with CompositeType) for display by
>> the cli. What you will get is a composite containing 3 components, the
>> first will be the string '2012-07-24', the second one will be the int
>> 2 and the last one will be the string 'alliance_involvement'.
>>
>> --
>> Sylvain
>>
>> >
>> > -Vivek
>> >
>> > On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne
>> > <sy...@datastax.com>
>> > wrote:
>> >>
>> >> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
>> >> wrote:
>> >> > Thanks Sylvain. I missed it. If i try to access these via thrift API,
>> >> > what
>> >> > will be the column names?
>> >>
>> >> I'm not sure I understand the question. The cli output is pretty much
>> >> what you get via the thrift API.
>> >>
>> >> --
>> >> Sylvain
>> >
>> >
>
>

Re: Missing non composite column

Posted by Vivek Mishra <mi...@gmail.com>.
Yes, i understand that. Reason why i am asking is, with this i need to
split them to get actual column name using ":" as a seperator.
Though i did not try it yet, but wondering if column name is like
"alliance:movement", then how do it compute it?


On Wed, Oct 17, 2012 at 1:04 PM, Sylvain Lebresne <sy...@datastax.com>wrote:

> On Wed, Oct 17, 2012 at 3:17 AM, Vivek Mishra <mi...@gmail.com>
> wrote:
> > column name will be "2012-07-24:2:alliance_involvement" or
> > "alliance_involvement"?
>
> The former. Though let's clarify that
> "2012-07-24:2:alliance_involvement" is the string representation of a
> composite name (i.e. one compatible with CompositeType) for display by
> the cli. What you will get is a composite containing 3 components, the
> first will be the string '2012-07-24', the second one will be the int
> 2 and the last one will be the string 'alliance_involvement'.
>
> --
> Sylvain
>
> >
> > -Vivek
> >
> > On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne <sylvain@datastax.com
> >
> > wrote:
> >>
> >> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
> >> wrote:
> >> > Thanks Sylvain. I missed it. If i try to access these via thrift API,
> >> > what
> >> > will be the column names?
> >>
> >> I'm not sure I understand the question. The cli output is pretty much
> >> what you get via the thrift API.
> >>
> >> --
> >> Sylvain
> >
> >
>

Re: Missing non composite column

Posted by Sylvain Lebresne <sy...@datastax.com>.
On Wed, Oct 17, 2012 at 3:17 AM, Vivek Mishra <mi...@gmail.com> wrote:
> column name will be "2012-07-24:2:alliance_involvement" or
> "alliance_involvement"?

The former. Though let's clarify that
"2012-07-24:2:alliance_involvement" is the string representation of a
composite name (i.e. one compatible with CompositeType) for display by
the cli. What you will get is a composite containing 3 components, the
first will be the string '2012-07-24', the second one will be the int
2 and the last one will be the string 'alliance_involvement'.

--
Sylvain

>
> -Vivek
>
> On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne <sy...@datastax.com>
> wrote:
>>
>> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
>> wrote:
>> > Thanks Sylvain. I missed it. If i try to access these via thrift API,
>> > what
>> > will be the column names?
>>
>> I'm not sure I understand the question. The cli output is pretty much
>> what you get via the thrift API.
>>
>> --
>> Sylvain
>
>

Re: Missing non composite column

Posted by Vivek Mishra <mi...@gmail.com>.
column name will be "2012-07-24:2:alliance_involvement" or
"alliance_involvement"?

-Vivek

On Tue, Oct 16, 2012 at 10:25 PM, Sylvain Lebresne <sy...@datastax.com>wrote:

> On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com>
> wrote:
> > Thanks Sylvain. I missed it. If i try to access these via thrift API,
> what
> > will be the column names?
>
> I'm not sure I understand the question. The cli output is pretty much
> what you get via the thrift API.
>
> --
> Sylvain
>

Re: Missing non composite column

Posted by Sylvain Lebresne <sy...@datastax.com>.
On Tue, Oct 16, 2012 at 12:31 PM, Vivek Mishra <mi...@gmail.com> wrote:
> Thanks Sylvain. I missed it. If i try to access these via thrift API, what
> will be the column names?

I'm not sure I understand the question. The cli output is pretty much
what you get via the thrift API.

--
Sylvain

Re: Missing non composite column

Posted by Vivek Mishra <mi...@gmail.com>.
Thanks Sylvain. I missed it. If i try to access these via thrift API, what
will be the column names?

-Vivek

If i try to access this row via thrift API, what would be the column names
returned?
On Tue, Oct 16, 2012 at 3:52 PM, Sylvain Lebresne <sy...@datastax.com>wrote:

> On Tue, Oct 16, 2012 at 11:57 AM, Vivek Mishra <mi...@gmail.com>
> wrote:
> > -------------------
> > RowKey: Jayne Cobb
> > => (column=2012-07-24:2:alliance_involvement, value=false,
> > timestamp=1350381005020000)
> > => (column=2012-07-24:2:energy_used, value=4.6,
> timestamp=1350381005020001)
> >
> >
> > Not sure, why is it not getting non-composite column(e.g.
> ships_destroyed in
> > this case).
>
> You have all the data in there. The ships_destroyed is the second
> component of each of your column names. That's just the way CQL3
> encodes things underneath.
>
> --
> Sylvain
>

Re: Missing non composite column

Posted by Sylvain Lebresne <sy...@datastax.com>.
On Tue, Oct 16, 2012 at 11:57 AM, Vivek Mishra <mi...@gmail.com> wrote:
> -------------------
> RowKey: Jayne Cobb
> => (column=2012-07-24:2:alliance_involvement, value=false,
> timestamp=1350381005020000)
> => (column=2012-07-24:2:energy_used, value=4.6, timestamp=1350381005020001)
>
>
> Not sure, why is it not getting non-composite column(e.g. ships_destroyed in
> this case).

You have all the data in there. The ships_destroyed is the second
component of each of your column names. That's just the way CQL3
encodes things underneath.

--
Sylvain