PHPCassa and Cassandra 1.2.1

685 views
Skip to first unread message

geekint...@gmail.com

unread,
Apr 5, 2013, 6:34:40 PM4/5/13
to phpc...@googlegroups.com
Hi

I have some code using phpcassa that works fine against Cassandra 1.1.6

But against Cassandra 1.2.1, it's throwing and exception with the following message

Cannot execute/prepare CQL2 statement since the CQL has been set to CQL3(This might mean your client hasn't been upgraded correctly to use the new CQL3 methods introduced in Cassandra 1.2+).

I'm pretty sure I have the latest php cassa.

Ideas?

Regards

G

Tyler Hobbs

unread,
Apr 8, 2013, 11:55:15 AM4/8/13
to phpc...@googlegroups.com
How are you executing cql methods? Are you trying to use cql 2 or 3?



--
You received this message because you are subscribed to the Google Groups "phpcassa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpcassa+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Tyler Hobbs
DataStax

geekint...@gmail.com

unread,
Apr 8, 2013, 12:25:32 PM4/8/13
to phpc...@googlegroups.com
I'm using the execute_cql_query method

And I set set_cql_version("3.0.0");

Regards

G

Tyler Hobbs

unread,
Apr 8, 2013, 12:36:33 PM4/8/13
to phpc...@googlegroups.com

On Mon, Apr 8, 2013 at 11:25 AM, <geekint...@gmail.com> wrote:
I'm using the execute_cql_query method

And I set set_cql_version("3.0.0");

Just use "execute_cql3_query(query, compression, consistency_level)" instead.  Note that unlike execute_cql_query, it calls for a ConsistencyLevel argument.

As usual, I'll note that phpcassa doesn't officially support cql at this time.

--
Tyler Hobbs
DataStax

geekint...@gmail.com

unread,
Apr 8, 2013, 1:25:36 PM4/8/13
to phpc...@googlegroups.com
I don't see that method in the ColumnFamily->client object.

Is it located elsewhere?

Regards

G

Tyler Hobbs

unread,
Apr 8, 2013, 2:56:01 PM4/8/13
to phpc...@googlegroups.com
Ah, it looks like phpcassa doesn't have the latest Thrift definitions for 1.2, so those will need to be updated before you can use execute_cql3_query.  I'll see if I can squeeze that in today or tomorrow.


--
You received this message because you are subscribed to the Google Groups "phpcassa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpcassa+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Tyler Hobbs
DataStax

geekint...@gmail.com

unread,
Apr 8, 2013, 5:25:32 PM4/8/13
to phpc...@googlegroups.com
Sounds great.

Thanks for the assist.

G

Tyler Hobbs

unread,
Apr 10, 2013, 12:37:41 PM4/10/13
to phpc...@googlegroups.com
Okay, I've updated the Thrift-generated files to match the latest Cassandra 1.2 definition in the master branch of phpcassa.

I also updated the Thrift php library itself, which changed how the namespacing works somewhat.  I don't believe there should be any problems around this, but if you see anything about classes not being found, let me know.

geekint...@gmail.com

unread,
Apr 11, 2013, 2:15:39 PM4/11/13
to phpc...@googlegroups.com
Great!

So I recompile the php so and copy the php code over?

Regards

G

geekint...@gmail.com

unread,
Apr 11, 2013, 5:13:28 PM4/11/13
to phpc...@googlegroups.com
So I got it installed and its tossing an exception on INSERT

#0 /var/www/gwr/db/lib/cassandra/Cassandra.php(5497): Thrift\Base\TBase->_read('Cassandra_execu...', Array, Object(Thrift\Protocol\TBinaryProtocolAccelerated)) #1 /var/www/gwr/db/lib/cassandra/Cassandra.php(2116): cassandra\Cassandra_execute_cql_query_result->read(Object(Thrift\Protocol\TBinaryProtocolAccelerated)) #2 /var/www/gwr/db/lib/cassandra/Cassandra.php(2076): cassandra\CassandraClient->recv_execute_cql_query() #3 /var/www/gwr/db/cassandra.php(129): cassandra\CassandraClient->execute_cql_query('INSERT INTO CF_...', 2) #4 /var/www/gwr/db/test.php(27): GwrCassandra->insertMonitor('5115010de3b3948...', '1', '1365204387', 'RA2') #5 {main}

Regards

G

geekint...@gmail.com

unread,
Apr 11, 2013, 5:14:03 PM4/11/13
to phpc...@googlegroups.com
This is the insert in question

INSERT INTO CF_raw (rowkey,eventtime,data) VALUES ('07193794aeffcbe501','1365204387000','RA2') USING TTL 5259486;

Works from a cqlsh.

G

geekint...@gmail.com

unread,
Apr 11, 2013, 5:49:23 PM4/11/13
to phpc...@googlegroups.com
Disregard.

When I switched to the execute_cql3_query method (like you said above) it worked like a champ.

Thanks!

Regards

G

Tyler Hobbs

unread,
Apr 12, 2013, 11:34:04 AM4/12/13
to phpc...@googlegroups.com
Great, glad to hear you got it working.  Thanks for the update.

geekint...@gmail.com

unread,
Apr 12, 2013, 3:02:39 PM4/12/13
to phpc...@googlegroups.com
Also, FWIW, in my private home sandbox I had the same error with Cassandra 1.2.3

This new phpcassa fixed it too.

Regards

G

adi...@gmail.com

unread,
Dec 23, 2013, 2:58:03 AM12/23/13
to phpc...@googlegroups.com
where can I download the new phpcassa?

בתאריך יום רביעי, 10 באפריל 2013 19:37:41 UTC+3, מאת Tyler Hobbs:
Reply all
Reply to author
Forward
0 new messages