Re: Adding large text blob causes read timeout...

2014-06-24 Thread Kevin Burton
oh.. the difference between the the ONE field and the remaining 29 is massive. It's like 200ms for just the 29 columns.. adding the extra one cause it to timeout .. 5000ms... On Mon, Jun 23, 2014 at 10:30 PM, DuyHai Doan doanduy...@gmail.com wrote: Don't forget that when you do the Select

Re: Adding large text blob causes read timeout...

2014-06-24 Thread DuyHai Doan
Yes but adding the extra one ends up by * 1000. The limit in CQL3 specifies the number of logical rows, not the number of physical columns in the storage engine Le 24 juin 2014 08:30, Kevin Burton bur...@spinn3r.com a écrit : oh.. the difference between the the ONE field and the remaining 29 is

Re: Can I call getBytes on a text column to get the raw (already encoded UTF8)

2014-06-24 Thread Olivier Michallat
Assuming we're talking about the DataStax Java driver: getBytes will throw an exception, because it validates that the column is of type BLOB. But you can use getBytesUnsafe: ByteBuffer b = row.getBytesUnsafe(aTextColumn); // if you want to check it: Charset.forName(UTF-8).decode(b);

Re: Can I call getBytes on a text column to get the raw (already encoded UTF8)

2014-06-24 Thread Robert Stupp
You can use getBytesUnsafe on the UTF8 column -- Sent from my iPhone Am 24.06.2014 um 09:13 schrieb Olivier Michallat olivier.michal...@datastax.com: Assuming we're talking about the DataStax Java driver: getBytes will throw an exception, because it validates that the column is of

How to perform Range Queries in Cassandra

2014-06-24 Thread Mike Carter
Hello! I'm a beginner in C* and I'm quite struggling with it. I’d like to measure the performance of some Cassandra-Range-Queries. The idea is to execute multidimensional range-queries on Cassandra. E.g. there is a given table of 1million rows with 10 columns and I like to execute some queries

Storing values of mixed types in a list

2014-06-24 Thread Tuukka Mustonen
Hello, I need to store a list of mixed types in Cassandra. The list may contain numbers, strings and booleans. So I would need something like list?. Is this possible in Cassandra and if not, what workaround would you suggest for storing a list of mixed type items? I sketched a few (using a list

Re: Does the default LIMIT applies to automatic paging?

2014-06-24 Thread Laing, Michael
And with python use future.has_more_pages and future.start_fetching_next_page(). On Tue, Jun 24, 2014 at 1:20 AM, DuyHai Doan doanduy...@gmail.com wrote: With the Java Driver, set the fetchSize and use ResultSet.iterator Le 24 juin 2014 01:04, ziju feng pkdog...@gmail.com a écrit : Hi All,

Re: Adding large text blob causes read timeout...

2014-06-24 Thread Jonathan Haddad
Can you do you query in the cli after setting tracing on? On Mon, Jun 23, 2014 at 11:32 PM, DuyHai Doan doanduy...@gmail.com wrote: Yes but adding the extra one ends up by * 1000. The limit in CQL3 specifies the number of logical rows, not the number of physical columns in the storage engine

Re: Storing values of mixed types in a list

2014-06-24 Thread Jeremy Jongsma
Use a ByteBuffer value type with your own serialization (we use protobuf for complex value structures) On Jun 24, 2014 5:30 AM, Tuukka Mustonen tuukka.musto...@gmail.com wrote: Hello, I need to store a list of mixed types in Cassandra. The list may contain numbers, strings and booleans. So I

Re: How to perform Range Queries in Cassandra

2014-06-24 Thread Jeremy Jongsma
You'd be better off using external indexing (ElasticSearch or Solr), Cassandra isn't really designed for this sort of querying. On Jun 24, 2014 3:09 AM, Mike Carter jaloos...@gmail.com wrote: Hello! I'm a beginner in C* and I'm quite struggling with it. I’d like to measure the performance

Re: Storing values of mixed types in a list

2014-06-24 Thread Pavel Kogan
1) You can use list of strings which are serialized JSONs, or use ByteBuffer with your own serialization as Jeremy suggested. 2) Use Cassandra 2.1 (not officially released yet) were there is new feature of user defined types. Pavel On Tue, Jun 24, 2014 at 9:18 AM, Jeremy Jongsma

Re: Can I call getBytes on a text column to get the raw (already encoded UTF8)

2014-06-24 Thread Kevin Burton
Yes… I confirmed that getBytesUnsafe works… I also have a unit test for it so if cassandra ever changes anything we'll pick it up. One point in your above code. I still think charsets are behind a synchronized code block. So your above code wouldn't be super fast on multi-core machines. I

Re: Storing values of mixed types in a list

2014-06-24 Thread Tuukka Mustonen
What if I need to query by list items? 1. Jeremy, with blob field (ByteBuffer), I can query exact matches (just encode the value in query), but greater/less than queries would not work. Any sort of serialization kills native ways to query data 2. Even with user defined types, I would need to

Re: Storing values of mixed types in a list

2014-06-24 Thread DuyHai Doan
Jeremy, with blob field (ByteBuffer), I can query exact matches (just encode the value in query), but greater/less than queries would not work. Any sort of serialization kills native ways to query data -- Not necessarily. You still use normal types (uuid, string, timestamp,...) for clustering

Re: Does the default LIMIT applies to automatic paging?

2014-06-24 Thread ziju feng
Does that mean the iterator will give me all the data instead of 1 rows? On Mon, Jun 23, 2014 at 10:20 PM, DuyHai Doan doanduy...@gmail.com wrote: With the Java Driver, set the fetchSize and use ResultSet.iterator Le 24 juin 2014 01:04, ziju feng pkdog...@gmail.com a écrit : Hi All,

Re: Does the default LIMIT applies to automatic paging?

2014-06-24 Thread DuyHai Doan
Yes. And I advise to set fetchSize to a smaller value than 10 000. 1000 is a good start. As long as there are still results, the iterator will fetch data for you by batch of fechtSize On Tue, Jun 24, 2014 at 9:03 PM, ziju feng pkdog...@gmail.com wrote: Does that mean the iterator will give me

EC2 cassandra cluster node address problem

2014-06-24 Thread Huiliang Zhang
Hi, I am using Cassandra on EC2 instances. My cassandra always returns private ips of the instances to the thrift program. Then the program cannot connect to the private ips. I already changed the rpc_address: elastic ip rpc_address: elastic ip Then I restarted the cassandra cluster. But the

Re: EC2 cassandra cluster node address problem

2014-06-24 Thread Andrey Ilinykh
Cassandra knows nothing about elastic ip. You have to use ssh tunnel or run your client on ec2 instance. Thank you, Andrey On Tue, Jun 24, 2014 at 8:55 PM, Huiliang Zhang zhl...@gmail.com wrote: Hi, I am using Cassandra on EC2 instances. My cassandra always returns private ips of the

Re: EC2 cassandra cluster node address problem

2014-06-24 Thread Huiliang Zhang
Thanks. Is there a way to configure Cassandra to use elastic ip instead of private ip? On Tue, Jun 24, 2014 at 9:29 PM, Andrey Ilinykh ailin...@gmail.com wrote: Cassandra knows nothing about elastic ip. You have to use ssh tunnel or run your client on ec2 instance. Thank you, Andrey

Re: Use Cassnadra thrift API with collection type

2014-06-24 Thread Huiliang Zhang
Yes, I realized the way to use CQL. I checked the way how map data is represented by using cassandra-cli. For each element in the map, it use the key as part of the column name and value as the column value. I just cannot insert this by using thrift API because I already defined a CompositeType

Re: EC2 cassandra cluster node address problem

2014-06-24 Thread Andrey Ilinykh
you can set rpc_address to 0.0.0.0, then it will listen on all interfaces. Also you have to modify security group settings to allow incoming connection for port 9160. But it is a really bad idea. By this way you open your cluster to whole world, ssh tunnel is the best way. On Tue, Jun 24, 2014