shaiwolf avatar image
shaiwolf asked Erick Ramirez edited

Driver 4.x Mapper problem with UDT

I managed to migrate the project's code from driver version 3.x to 4.x.

However when process initializes the DAOs I get the error below.

It seems that the auto generated code is trying to locate the UDT's fields inline as entity columns.

2021-11-21 10:41:53,805 [localhost-startStop-1] FATAL esEngine.ProfilesEngineServlet  - ProfilesEngineServlet Failed to init due to exception
java.lang.IllegalArgumentException: The CQL ks.table: proj.profile has missing columns: [partner_id, campaign_id] that are defined in the entity class: com.proj.bean.Campaign
        at com.proj.bean.CampaignHelper__MapperGenerated.validateEntityFields(
        at com.proj.cql3client.daoimpl.ProfileAccessorImpl__MapperGenerated.initAsync(
        at com.proj.cql3client.daoimpl.ProfileAccessorImpl__MapperGenerated.init(
        at com.proj.cql3client.MainDaoMapperImpl__MapperGenerated.lambda$profileAccessor$28(
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(
        at com.proj.cql3client.MainDaoMapperImpl__MapperGenerated.profileAccessor(
        at com.proj.cql3client.daoimpl.ProfileDao.<init>(

I have a profile entity containing a list of campaigns:

@CqlName ("profile")
public class Profile {
   private List<Campaign> campaigns;

Campaign is a user defined type:

@CqlName ("campaign")
public class Campaign {
    private int partnerId;

    private int campaignId;

In cassandra campaign type is defined:

CREATE TYPE campaign (
    partner_id int,
    campaign_id int

and the profile table is defined:

CREATE TABLE profile (
    campaigns list<frozen<campaign>>,

Registering a codec didn't solve the problem.

Does anyone know how to solve this issue?



java driveruser-defined type
1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

shaiwolf avatar image shaiwolf commented ·


Any idea guys?


0 Likes 0 ·

1 Answer

absurdfarce avatar image
absurdfarce answered Erick Ramirez edited

Hey @shaiwolf , thanks for posting!

I tried to reproduce the errors you describe but was unable to do so. I tried to use as much as possible from your sample code above but my sample code worked with UDTs out of the gate. I've pushed my sample to Github at Feel free to take a look and let me know if there's something substantially different between what I'm doing and what your code is doing.

An additional question: what version of the Java driver are you using? My sample uses 4.13.0 (which is quite recent) but if you're using something older in the 4.x line it's certainly possible that you could be hitting an earlier bug that's since been resolved. I'd like to test my impl with the precise version of the Java driver you're using so please let me know!

Thanks again!


10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.