evseevnn-zz / php-cassandra-binary

PHP library for Cassandra database via a binary protocol.
http://evseevnn.github.io/php-cassandra-binary/
MIT License
69 stars 33 forks source link

UDT Support #57

Open steambao opened 9 years ago

steambao commented 9 years ago

Hi Guys,

Using Cassandra 2.1.2 and trying to get UDTs to work in the library, and since everyone is busy figured I would give it a shot. However, having trouble.

Looking at the v3 Binary Protocol (https://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=blob_plain;f=doc/native_protocol_v3.spec;hb=HEAD), I notice a new column type. 0x0030 UDT: the value is < ks >< udt_name >< n >< name_1 >< type_1 >...< name_n >< type_n >

However, in evseevnn\Cassandra\Protocol\Response\DataStream\TypeReader class, public static function readFromStream(DataStream $stream) {...} always reads a UDT type as '0' instead of the expected '48'.

Thus, I can't get the library to differentiate a 'custom' column from a 'UDT' column when generating the column meta-data; and so I can't properly process 'reading' the datastream. Any ideas? Am I on the right track?

steambao commented 9 years ago

I guess it's because we still using V1 of Binary Protocol?

class VersionEnum { const REQUEST = 0x01; const RESPONSE = 0x81; }

evseevnn-zz commented 9 years ago

Hi! You're right. The point is that fully maintain the library is not enough time. It must be modified to support the protocol v3.

I would be glad if you help with this.

steambao commented 9 years ago

Hey evseevnn. You probably already know this (since you commited heaps to this repo), but https://github.com/duoshuo/php-cassandra has full UDT support as well as v3 protocol currently working.