php-cassandra-binary icon indicating copy to clipboard operation
php-cassandra-binary copied to clipboard

UDT Support

Open steambao opened this issue 10 years ago • 3 comments

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 avatar Jan 12 '15 18:01 steambao

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

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

steambao avatar Jan 13 '15 03:01 steambao

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.

evseevnn-zz avatar Jan 13 '15 04:01 evseevnn-zz

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.

steambao avatar Feb 11 '15 05:02 steambao