Skip to content

Conversation

@Sfurti-yb
Copy link

Problem:

Getting the “error java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.datastax.oss.driver.api.core.type.SetType” when IN Clause contains list as the bound variable. More details here.

Reason:

The issue was because the list types and set types were handled similarly in the 4.x driver where the Datatype was explicitly converted to Set type. In the 4.x driver, DataType is an interface, which different datatypes implement.
The issue did not come on the 3.x driver because there was no explicit type conversion, since datatype is not an interface in the 3.x driver but a class that handles all the data types.

Solution:

Added a different implementation for list type

@ashetkar
Copy link

Please raise the PR for the test case also.

@Sfurti-yb
Copy link
Author

Added the test here

@Sfurti-yb Sfurti-yb merged commit 8bda7ac into 4.15.x Jan 11, 2024
@ashetkar ashetkar deleted the DB-8970-fix-4.15 branch April 2, 2024 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants