StackOverflowError on mapper creation for UDTs containing circular references

Description

Hi folks,

I tried to persisit a tree structure using UDT and mapper, but got a StackOverflowError. The problem is the endless recursion on UDT mapper creation for the circular referenced class member.

Cassandra-KS:

tree.cql

Node UDT:

Node.java

Tree table

Tree.java

Test class

TreeTest.java

Stacktrace

Environment

java driver 2.1.X and 2.2.X

Pull Requests

None

Activity

Show:
Olivier Michallat
September 15, 2015, 9:07 AM

I don't think UDTs can be recursive. You've found a workaround with ALTER TYPE, but notice that you can't insert recursive data, the second level doesn't have the children property:

So I'm leaning towards ALTER being too permissive. I'm checking with the Cassandra devs, if that's the case I'll open a ticket in their JIRA to prevent that kind of schema to be created.

Olivier Michallat
September 15, 2015, 9:31 AM
Olivier Michallat
September 15, 2015, 10:26 AM

Confirmed that Cassandra should not allow this. See CASSANDRA-10339.

Not a Problem

Assignee

Unassigned

Reporter

Roman Kondrashov

Labels

PM Priority

None

Reproduced in

2.1.7.1
2.2.0-rc3

Affects versions

Fix versions

None

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Priority

Major
Configure