lua-cassandra icon indicating copy to clipboard operation
lua-cassandra copied to clipboard

`client:execute` function returns `unserializable table`

Open howiezhao opened this issue 2 years ago • 1 comments

On my ARM machine (M1 MacBook Pro), when I call the execute (such as SELECT * FROM test;) function, it returns me an unserializable table. On x86 machines, it can return a serializable table.

After my investigation, if there is a column in my Cassandra table schema that is of map<timestamp, text> or map<timestamp, int> type, it will not be serialized on ARM, but it will be normal on x86.

I found that on an x86 machine, it can convert a number key to a string type, but on an arm machine, it cannot, which may be the reason why the table cannot be serialized.

How can I find out the real reason? Any suggestions? grateful.

howiezhao avatar Apr 11 '23 09:04 howiezhao

when the key is int and it is greater than 10, the serialize will occur error.

> x= { [11]="a"} return (require "cjson.safe").encode(x)
nil	Cannot serialise table: excessively sparse array
> x= { [10]="a"} return (require "cjson.safe").encode(x)
[null,null,null,null,null,null,null,null,null,"a"]

ximouzhao avatar Nov 01 '23 01:11 ximouzhao