Skip to content

[client-v2] failing when serializing nested nullable columns. #1858

Closed
@javiercj93

Description

Describe the bug

Create the following table

Steps to reproduce

  1. Create a table with a nested column which has a nullable field.
CREATE TABLE test.visits
(
    CounterID UInt32,
    StartDate Date,
    Sign Int8,
    IsNew UInt8,
    VisitID UInt64,
    UserID UInt64,
    Goals Nested
    (
        ID UInt32,
        Serial UInt32,
        EventTime DateTime,
        Price Nullable(Int32),
        OrderID String,
        CurrencyID UInt32
    )
) ENGINE = CollapsingMergeTree(StartDate, intHash32(UserID), (CounterID, StartDate, intHash32(UserID), VisitID), 8192, Sign)
  1. Insert a visit with goals Price containing a null value:

Expected behaviour

Since it is possible to create such nullable fields, the client should be able to handle them and serialize them successfully.

Error log

Caused by: java.lang.IllegalArgumentException: Cannot convert null to Integer
		at com.clickhouse.client.api.internal.SerializerUtils.convertToInteger(SerializerUtils.java:225)

Environment

  • Client version: 0.7.0
  • Language version: java17
  • OS:

ClickHouse server

  • ClickHouse Server version: 23.3.18.15

I have created this PR which fixes the issue (apparently)

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions