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

Array(IPv6) type check is broken for capnp format #46522

Closed
burov4j opened this issue Feb 17, 2023 · 1 comment · Fixed by #46616
Closed

Array(IPv6) type check is broken for capnp format #46522

burov4j opened this issue Feb 17, 2023 · 1 comment · Fixed by #46616

Comments

@burov4j
Copy link

burov4j commented Feb 17, 2023

I use kafka engine and capnp schema to insert data to my clickhouse servers.
After upgrade from the clickhouse 21.8.15.7 to 22.3.12.19 my capnp deserlialization was broken. Please see #43319 to get more details.

The ticket #43319 was fixed in #43379, but we still have problems in the last clickhouse version (23.1.3.5). Now we cannot convert ClickHouse type Array(IPv6) to CapnProto type List(Data).

Steps to reproduce

Create the table:

create table ArrayIPv6Example
(
    myField Array(IPv6)
) engine MergeTree
order by tuple();

Create schema.capnp file:

@0xb6ecde1cd54a101d;

struct ArrayIPv6Example {
    myField @0 :List(Data);
}

Execute command: clickhouse-client --query "SELECT * FROM ArrayIPv6Example FORMAT CapnProto SETTINGS format_schema = 'schema:ArrayIPv6Example'".

You will see the error: Code: 623. DB::Exception: Code: 623. DB::Exception: Cannot convert ClickHouse type Array(IPv6) to CapnProto type List(Data). (CAPN_PROTO_BAD_CAST) (version 23.1.3.5 (official build)): (in query: SELECT * FROM ArrayIPv6Example FORMAT CapnProto SETTINGS format_schema = 'schema:ArrayIPv6Example'). (CAPN_PROTO_BAD_CAST)

@Avogar is it possible to add a new config in clickhouse to disable this type checks?

@Avogar
Copy link
Member

Avogar commented Feb 17, 2023

It was broken in #43221. Before this PR IPv4/IPv6 were implemented as custom types with real types UInt32/FixedString(16), so their deserialization/serialization in binary format worked just like values have types UInt32/FixedString(16). Now it's totally separate type and we need to add support for it in some data formats, including CapnProto. Thanks for your report, I will fix it and backport (as I see, only 23.1 version is affected)

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