astyanax
astyanax copied to clipboard
astyanax-cql support for collections set, list and map
Dear Engineers,
We are trying to read the SET
Code here:
Column<String> column = columns.getColumnByName(LabelVerticesFieldEnum.PATHS.getFieldStr());
SetSerializer<String> serializer = new SetSerializer<>(UTF8Type.instance);
if (!CommonUtils.isNullOrBlank(column.getValue(serializer))) {
labelVertices.setPaths(column.getValue(serializer));
}
The datastax row has a method to access the SET values, but there is no way from the CqlColumnImpl i could access it.
Here is the datastax row method:
public class Row {
public <T> Set<T> getSet(int i, Class<T> elementsClass)
}
Instead the column.getValue(serializer) hits this method in the datastax driver:
public ByteBuffer getBytes(int i) {
metadata.checkType(i, DataType.Name.BLOB);
return getBytesUnsafe(i);
}
that throws this exception - datastax.driver.core.exceptions.InvalidTypeException: Value paths is of type set
Any idea when this would be supported?
Is there anything we are doing wrong? Please let me know.
We wanted to move away from ThriftFamilyFactory and use the CqlFamilyFactory.
Thanks, Chandran.
I added a quick fix for astyanax-cql to work for collection set:
https://gist.github.com/7032ced375bedb9b81b3
If you like this, i would like to submit a patch for all the collections - set, list and map.
Please let me know.