Re: CQL Thrift

2013-08-30 Thread Jon Haddad
If you're going to work with CQL, work with CQL. If you're going to work with Thrift, work with Thrift. Don't mix. On Aug 30, 2013, at 10:38 AM, Vivek Mishra mishra.v...@gmail.com wrote: Hi, If i a create a table with CQL3 as create table user(user_id text PRIMARY KEY, first_name text,

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
And surprisingly if i alter table as : alter table user add first_name text; alter table user add last_name text; It gives me back column with values, but still no indexes. Thrift and CQL3 depends on same storage engine. Do they really maintain different metadata for same column family? -Vivek

Re: CQL Thrift

2013-08-30 Thread Peter Lin
in my case, I built a temporal database on top of Cassandra, so it's absolutely key. Dynamic columns are super powerful, which relational database have no equivalent. For me, that is one of the top 3 reasons for using Cassandra. On Fri, Aug 30, 2013 at 2:03 PM, Vivek Mishra

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
Hi, I understand that, but i want to understand the reason behind such behavior? Is it because of maintaining different metadata objects for CQL3 and thrift? Any suggestion? -Vivek On Fri, Aug 30, 2013 at 11:15 PM, Jon Haddad j...@jonhaddad.com wrote: If you're going to work with CQL, work

Re: CQL Thrift

2013-08-30 Thread Jon Haddad
Could you please give a more concrete example? On Aug 30, 2013, at 11:10 AM, Peter Lin wool...@gmail.com wrote: in my case, I built a temporal database on top of Cassandra, so it's absolutely key. Dynamic columns are super powerful, which relational database have no equivalent. For

Re: CQL Thrift

2013-08-30 Thread Jonathan Ellis
http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows On Fri, Aug 30, 2013 at 12:53 PM, Peter Lin wool...@gmail.com wrote: my bias perspective, I find the sweet spot is thrift for insert/update and CQL for select queries. CQL is too limiting and negates the power of

Re: CQL Thrift

2013-08-30 Thread Jon Haddad
Just curious - what do you need to do that requires thrift? We've build our entire platform using CQL3 and we haven't hit any issues. On Aug 30, 2013, at 10:53 AM, Peter Lin wool...@gmail.com wrote: my bias perspective, I find the sweet spot is thrift for insert/update and CQL for

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
CQL is too limiting and negates the power of storing arbitrary data types in dynamic columns. I agree but partly. You can always create column family with key, column and value and store any number of arbitrary columns as column name in column and it's corresponding value with value. I find it

Re: CQL Thrift

2013-08-30 Thread Peter Lin
I use dynamic columns all the time and they vary in type. With CQL you can define a default type, but you can't insert specific types of data for column name and value. It forces you to use all bytes or all strings, which would require coverting it to other types. thrift is much more powerful in

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
True for newly build platform(s), but what about existing apps build using thrift? As per http:// www.datastax.com/dev/blog/thrift-to-cql3http://www.datastax.com/dev/blog/thrift-to-cql3 it should be easy. I am just curious to understand the real reason behind such behavior. -Vivek On Fri, Aug

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
If you talk about comparator. Yes, that's a valid point and not possible with CQL3. -Vivek On Fri, Aug 30, 2013 at 11:31 PM, Peter Lin wool...@gmail.com wrote: I use dynamic columns all the time and they vary in type. With CQL you can define a default type, but you can't insert specific

Re: CQL Thrift

2013-08-30 Thread Peter Lin
In the interest of education and discussion. I didn't mean to say CQL3 doesn't support dynamic columns. The example from the page shows default type defined in the create statement. create column family data with key_validation_class=Int32Type and comparator=DateType and

Re: CQL Thrift

2013-08-30 Thread Jon Haddad
It sounds like you want this: create table data ( pk int, colname blob, value blob, primary key (pk, colname)); that gives you arbitrary columns (cleverly labeled colname) in a single row, where the value is value. If you don't want the overhead of storing colname in every row, try with

Re: CQL Thrift

2013-08-30 Thread Les Hazlewood
On Fri, Aug 30, 2013 at 10:58 AM, Jon Haddad j...@jonhaddad.com wrote: Just curious - what do you need to do that requires thrift? We've build our entire platform using CQL3 and we haven't hit any issues. Here's one thing: If you're using wide rows and you want to do anything other than just

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
Did you try to explore CQL3 collection support for the same? You can definitely save on number of rows with that. Point which i am trying to make out is, you can achieve it via CQL3 ( Jonathan's blog : http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows) I agree with you

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
@lhazlewood https://issues.apache.org/jira/browse/CASSANDRA-5959 Begin batch multiple insert statements. apply batch It doesn't work for you? -Vivek On Sat, Aug 31, 2013 at 12:21 AM, Les Hazlewood lhazlew...@apache.orgwrote: On Fri, Aug 30, 2013 at 10:58 AM, Jon Haddad

CQL Thrift

2013-08-30 Thread Vivek Mishra
Hi, If i a create a table with CQL3 as create table user(user_id text PRIMARY KEY, first_name text, last_name text, emailid text); and create index as: create index on user(first_name); then inserted some data as: insert into user(user_id,first_name,last_name,emailId)

Re: CQL Thrift

2013-08-30 Thread Peter Lin
CQL3 collections is meant to store stuff that is list, set, map. Plus, collections currently do not supporting secondary indexes. The point is often you don't know what columns are needed at design time. If you know what's needed, use static columns. Using a list, set or map to store data you

Re: CQL Thrift

2013-08-30 Thread Alex Popescu
On Fri, Aug 30, 2013 at 11:56 AM, Vivek Mishra mishra.v...@gmail.comwrote: @lhazlewood https://issues.apache.org/jira/browse/CASSANDRA-5959 Begin batch multiple insert statements. apply batch It doesn't work for you? -Vivek According to the OP batching inserts is slow. The SO

Re: CQL Thrift

2013-08-30 Thread Jon Haddad
It seems really strange to me that you're create a table with specific types then try to deviate from it. Why not just use the blob type, then you can store whatever you want in there? The whole point of adding strong typing is to adhere to it. I wouldn't consider it a fault of the database

Re: CQL Thrift

2013-08-30 Thread Vivek Mishra
create a column family as: create table dynamicTable(key text, nameAsDouble double, valueAsBlob blob); insert into dynamicTable(key, nameAsDouble, valueAsBlob) values ( key, double(102.211), textAsBlob('valueInBytes'). Do you think, it will work in case column name are double? -Vivek On Sat,

Re: CQL Thrift

2013-08-30 Thread Les Hazlewood
Yes, that's correct - and that's a scaled number. In practice: On the local dev machine, CQL3 inserting 10,000 columns (for 1 row) in a BATCH took 1.5 minutes. 50,000 columns (the desired amount) in a BATCH took 7.5 minutes. The same Thrift functionality took _235 milliseconds_. That's almost

Re: CQL Thrift

2013-08-30 Thread Peter Lin
This has nothing to do with compact storage. Cassandra supports arbitrary dynamic columns of different name/value type today. If people are happy with SQL metaphor, then CQL is fine. Then again, if SQL metaphor was good for temporal databases, there wouldn't be so many failed temporal databases

Re: CQL Thrift

2013-08-30 Thread Peter Lin
my bias perspective, I find the sweet spot is thrift for insert/update and CQL for select queries. CQL is too limiting and negates the power of storing arbitrary data types in dynamic columns. On Fri, Aug 30, 2013 at 1:45 PM, Jon Haddad j...@jonhaddad.com wrote: If you're going to work with

Re: SQL Injection C* (via CQL Thrift)

2013-06-20 Thread aaron morton
Date: Tuesday, June 18, 2013 8:51 AM To: user@cassandra.apache.org user@cassandra.apache.org Subject: Re: SQL Injection C* (via CQL Thrift) If you're not careful, then CQL injection is possible. Say you naively build you query with UPDATE foo SET col=' + user_input + ' WHERE key = 'k

Re: SQL Injection C* (via CQL Thrift)

2013-06-20 Thread Robert Coli
On Thu, Jun 20, 2013 at 2:15 AM, aaron morton aa...@thelastpickle.com wrote: As for the thrift side (i.e. using Hector or Astyanax), anyone have a crafty way to inject something? The only thing I've ever heard of coming close was a thrift bug that allowed a malformed request to crash the

Re: SQL Injection C* (via CQL Thrift)

2013-06-20 Thread Edward Capriolo
My first interaction with cassandra: ../nodeprobe -p 9160 ... Hum I can't seem to reach it :) Ow its no longer running... You've come along way baby. On Thu, Jun 20, 2013 at 12:59 PM, Robert Coli rc...@eventbrite.com wrote: On Thu, Jun 20, 2013 at 2:15 AM, aaron morton aa...@thelastpickle.com

SQL Injection C* (via CQL Thrift)

2013-06-18 Thread Brian O'Neill
Mostly for fun, I wanted to throw this out there... We are undergoing a security audit for our platform (C* + Elastic Search + Storm). One component of that audit is susceptibility to SQL injection. I was wondering if anyone has attempted to construct a SQL injection attack against Cassandra?

Re: SQL Injection C* (via CQL Thrift)

2013-06-18 Thread Sylvain Lebresne
If you're not careful, then CQL injection is possible. Say you naively build you query with UPDATE foo SET col=' + user_input + ' WHERE key = 'k' then if user_input is foo' AND col2='bar, your user will have overwritten a column it shouldn't have been able to. And something equivalent in a

Re: SQL Injection C* (via CQL Thrift)

2013-06-18 Thread Brian O'Neill
. From: Sylvain Lebresne sylv...@datastax.com Reply-To: user@cassandra.apache.org Date: Tuesday, June 18, 2013 8:51 AM To: user@cassandra.apache.org user@cassandra.apache.org Subject: Re: SQL Injection C* (via CQL Thrift) If you're not careful, then CQL injection is possible. Say you naively

Re: Cassandra, CQL, Thrift Deprecation?? and Erlang

2011-09-02 Thread Jonathan Ellis
The Thrift API is not going anywhere any time soon. I'm not aware of anyone working on an erlang CQL client. On Fri, Sep 2, 2011 at 7:39 AM, J T jt4websi...@googlemail.com wrote: Hi, I'm a fan of erlang, and have been using successive cassandra versions via the erlang thrift interface for a

Re: Cassandra, CQL, Thrift Deprecation?? and Erlang

2011-09-02 Thread J T
Ok, thats good to know. If push came to shove I could probably write such a client myself after doing the necessary research but I'd prefer to save myself the hassle. Thanks. On Fri, Sep 2, 2011 at 1:59 PM, Jonathan Ellis jbel...@gmail.com wrote: The Thrift API is not going anywhere any time