Hi
When I bind a Set to a "select * from mytable where colx in ?" like:
ps.bind(EnumSet.of(E1, E2))
I get the following exception:
Codec not found for requested operation: [list<varchar> <-> java.util.RegularEnumSet]: com.datastax.driver.core.exceptions.CodecNotFoundException com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [list<varchar> <-> java.util.RegularEnumSet]
at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:741)
at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:602)
at com.datastax.driver.core.CodecRegistry.findCodec(CodecRegistry.java:582)
at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:507)
at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:77)
at com.datastax.driver.core.BoundStatement.bind(BoundStatement.java:201)
at com.datastax.driver.core.DefaultPreparedStatement.bind(DefaultPreparedStatement.java:126)
If I instead convert the Set to a List like:
ps.bind(new ArrayList(EnumSet.of(E1, E2))) it works as expected, but that is an ugly workaround.
Is this a bug or expected behaviour?
I'm fan of strong typing and try to use enums as much as possible and from that follows the need of using Sets in in clauses, in the above example I have registed the appropriate EnumNameCodec.
This was tested with driver version 3.3.2.
Best regards Jens