Skip to content

Fix for the Prepared IN Clause giving java.lang.ClassCastException error For 4.15.x #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2024

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.

2 participants