Skip to content

Conversation

@bk-mz
Copy link

@bk-mz bk-mz commented Jan 9, 2026

This example demonstrates an issue when using the POJO serializer with nested custom objects.

Test Case

Schema:

address Nested(street String, city String)

POJO:

public class ArticleViewEvent {
    private Address address;
}

public class Address {
    private String street;
    private String city;
}

Usage:

Address address = new Address("123 Main St", "San Francisco");
pojoWriter.submit(new ArticleViewEvent(..., address));

Error

WARN com.clickhouse.client.api.serde.POJOSerDe - No getter method found for column: addressstreet
Exception: No serializer found for column 'address.street'. Did you forget to register it?

The POJO serializer looks for getAddressStreet() and getAddressCity() methods (flattened column names) but the POJO only has getAddress() returning an Address object. The serializer doesn't traverse nested object graphs.

To run the example:

docker run -d -p 8123:8123 clickhouse/clickhouse-server
cd examples/client-v2
mvn exec:java -Dexec.mainClass="com.clickhouse.examples.client_v2.Main"

Note

Introduces a nested POJO example to exercise ClickHouse Nested/Tuple serialization.

  • Adds Address class and embeds it in ArticleViewEvent as address
  • Updates table schema in article_view_event_init.sql to include address Nested(street String, city String)
  • Modifies Main.java to construct Address and submit it via POJO2DbWriter

This demonstrates the serializer behavior with nested custom objects (per PR description).

Written by Cursor Bugbot for commit 3bf8d00. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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