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

Support nested @UserDefinedType for schema creation [DATACASS-406] #573

spring-projects-issues opened this issue Feb 25, 2017 · 1 comment
type: bug A general bug


Copy link

Michel Zanini opened DATACASS-406 and commented


@UserDefinedType can be used to auto-create user types on schema generation.
However, it does not seem to be supported when a @UserDefinedType object has a property which is also a user defined type.

For example:

public class Trip {
  UUID id;
  Destination destination;

public class Destination {
  TimeZone timeZone;

public class TimeZone {
  String timeZoneId;
  String timeZoneCode;
  String offset;

I have added a sample project attached which demonstrates the problem.
If schema generation is configured:

Then the app will crash on startup trying to create the user defined types:

Caused by: User type [timezone] not found

However, if schema generation is disabled:

And the schema is created manually, then the mapping is supported and it read and save data correctly.

 id                                   | destination                                                                                                         | timezone
 3b8628a1-fb8c-11e6-a469-27823ad07e50 | {latitude: -23.5, longitude: 84.43, timezone: {timezoneid: 'Europe/Dublin', timezonecode: 'IST', offset: '+01:00'}} | {timezoneid: 'Europe/Dublin', timezonecode: 'IST', offset: '+01:00'}

This nested structure is supported by Cassandra. By Spring Data is only supported if used without schema generation.

Can we support auto creation of these nested types for auto creating the schema, please?

Affects: 1.5.1 (Ingalls SR1), 2.0 M1 (Kay)


Referenced from: pull request #100

Backported to: 1.5.1 (Ingalls SR1)

Copy link

Mark Paluch commented

Thanks for reporting this issue which is actually a bug. We have some code to determine dependencies between user-defined types to create types in Apache Cassandra in the right order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
type: bug A general bug
None yet

No branches or pull requests

2 participants