Astyanax: simple write throwing this exception: Not enough bytes to read value of component

前端 未结 2 1489
一整个雨季
一整个雨季 2021-01-12 01:36

I am new to astyanax and trying some sample programs and getting this error. This is a simple write and looks like am doing some thing basic wrong. Not using composite keys.

相关标签:
2条回答
  • 2021-01-12 01:55

    I'm also new to Astyanax and encountering the the same exceptions. The exception is due to a mismatch between what Astyanax Thrift-based objects think the column definition should look like and how it is store in 1.2+ using CQL 3. I learned specifying COMPACT STORAGE so that the table is created in the pre 1.2 format will allow me interact with it via the Thrift-based objects. FWIW: I'm building Astyanax from source, but I did see a 1.56.34 in maven central; I would update to that also.

    CREATE TABLE test (
     col1 text PRIMARY KEY,
     col2 text,
     col3 text
    ) WITH COMPACT STORAGE AND
    ...
    

    See Working with pre-CQL 3 applications

    0 讨论(0)
  • 2021-01-12 02:05

    I solution provided by user2251060 does the job. In addition, Netflix is working on a new version of Astyanax that depends on the Datastax java driver to convert the thrift objects to the underlying CQL based ones. You can find more information at https://github.com/Netflix/astyanax/wiki/Astyanax-over-Java-Driver

    0 讨论(0)
提交回复
热议问题