Skip to content
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

Cannot write composite key that contains a UDT to Where #1137

Closed
samueldlightfoot opened this issue May 25, 2021 · 1 comment
Closed

Cannot write composite key that contains a UDT to Where #1137

samueldlightfoot opened this issue May 25, 2021 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@samueldlightfoot
Copy link
Contributor

samueldlightfoot commented May 25, 2021

When trying to create a query in which the primary key is a composite consisting of a UDT and other fields (i.e. not just a UDT) an error is thrown during the WHERE statement generation.

The issue is 'Cannot resolve DataType for com.datastax.oss.driver.api.core.data.UdtValue'.

I have replicated this in the MappingCassandraConverterUDTUnitTests::shouldWriteUdtWhereWherePrimaryKeyWithCustomConversions test by modiying the Money class to contain a composite primary key (Currency plus another String property as key) rather than just the Currency UDT.

See failing test changes here: samueldlightfoot@b68892e

Issue tested on version 3.3.0 and 3.1.8.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 25, 2021
@mp911de mp911de self-assigned this Jun 7, 2021
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 7, 2021
@mp911de mp911de changed the title Cannot write composite key that contains a UDT Cannot write composite key that contains a UDT to Where Jun 7, 2021
@mp911de
Copy link
Member

mp911de commented Jun 7, 2021

Thanks for report. Writing an object with a composite key with a UDT to Where failed because the writing code didn't use the proper method. Generally writing objects using composite keys with UDTs works. We need to fix the Where part.

@mp911de mp911de closed this as completed in c2c1247 Jun 7, 2021
mp911de added a commit that referenced this issue Jun 7, 2021
…s with user-defined types.

We now correctly write properties from composite primary keys to the Where condition object. Previously, the object write used writeWhereFromObject(…) that isn't converter/UDT/tuple-type-aware.

Closes #1137.
mp911de added a commit that referenced this issue Jun 7, 2021
…s with user-defined types.

We now correctly write properties from composite primary keys to the Where condition object. Previously, the object write used writeWhereFromObject(…) that isn't converter/UDT/tuple-type-aware.

Closes #1137.
@mp911de mp911de added this to the 3.1.10 (2020.0.10) milestone Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants