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

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

Closed
javiercj93 opened this issue Oct 8, 2024 · 1 comment · Fixed by #1857
Closed

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

javiercj93 opened this issue Oct 8, 2024 · 1 comment · Fixed by #1857

Comments

@javiercj93
Copy link
Contributor

javiercj93 commented Oct 8, 2024

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)

@chernser
Copy link
Contributor

chernser commented Oct 9, 2024

@javiercj93 Thank you for reporting!
We will review the PR.

@chernser chernser added this to the 0.7.1 milestone Oct 9, 2024
@chernser chernser changed the title Client v2 failing when serializing nested nullable columns. [client-v2] failing when serializing nested nullable columns. Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants