-
Notifications
You must be signed in to change notification settings - Fork 64
Support for reading collections in results is missing #96
Comments
Interesting, I was under the impression that those were only available via the Binary protocol. If they work via the thrift protocol that would be great. Can you turn this into a pull request with some tests maybe? |
Also, it seems that this will only de-serialize the objects. What about serialization? How do we differentiate between a collection and a CompositeType when entering data into the column? |
Yes the only problem I face at this time was to get stuff out since inserting/updating seems to work fine at the moment if used like this.. INSERT INTO users (id, permissions) VALUES (e988aea0-9682-11e2-9e96-0800200c9a66, {'a': ?, 'b': ?}); Not 100% sure how everything works yet and have a deadline so just need something that works for now. |
Inserting was already done with my implementation, only deserialization was missing. |
@michaelmitchell can you please create pull request for that? |
@industral Does your 7b26591 fix actually work? For me it seems that it returns the function instead of the data. |
@srlmproductions you right, it was bad commit. |
It looks like it would be possible to have some sort of automatic algorithm, at least based on the output of row._schema:
Here's my attempt at making a simple list(float) parser. You need to pass it the binary data that the helenus protocol returns: DecodeRawFloatData = function(buffer){
var offset = 0;
var num_elements = buffer.readUInt16BE(offset);
offset += 2;
result = [];
for(var i = 0; i < num_elements; i++){
var element_size = buffer.readUInt16BE(offset);
offset += 2;
result.push(buffer.readFloatBE(offset));
offset += 4;
}
return result;
}; |
Wouldn't that only work for types that have a predictable length? Would this work for say, |
I'm still getting the issue @srlmproductions ran into with the deserializer simply returning the function rather than the value. When inspecting the entire column, the Has the commit stated as bad not made it into npm registry? |
I notice there is some code in there for ListType, SetType and MapType but no actual code to de-serialize them.
This works
The text was updated successfully, but these errors were encountered: