phpcassa icon indicating copy to clipboard operation
phpcassa copied to clipboard

batch_insert and CompositeType

Open sarral opened this issue 12 years ago • 3 comments

What is the syntax to batch_insert into a Composite RowKey?

On regular Insert the key is array of values. No problem there.

I've tried: serialize( array(1,2)) as KEY

CF CompisiteType (LongInt,LongInt)

It does insert into '0' RowKey.

sarral avatar Jan 05 '13 01:01 sarral

What are you using for your $column_family->insert_format? Here's an example of batch_insert using ARRAY_FORMAT: https://github.com/thobbs/phpcassa/blob/master/examples/alternate_formats.php#L57

thobbs avatar Jan 31 '13 23:01 thobbs

Insert format is ARRAY_FORMAT. I'm using 1.0.a.5 version

Thank you for the refrence.
I'll give it another try. It seems pretty straight forward. Don't know why I had issues.

sarral avatar Jan 31 '13 23:01 sarral

Example shows batch_insert() on a NON-Composite RowKey type. No Help. I have this figured out.

I can't figure out how to batch insert into a CompositeType RowKey (LongType,IntegerType).

I've tried to make the key:

  1. KEY = '12334:123'
  2. KEY = array(12334,123)
  3. KEY = '12334,123'
  4. KEY = serialize( array(12334,123) ) .... all with no luck.

I don't know why my text is bold.

sarral avatar Feb 01 '13 00:02 sarral