ClickHouse / metabase-clickhouse-driver

ClickHouse database driver for the Metabase business intelligence front-end
Apache License 2.0
476 stars 92 forks source link

IPv4 field starts with dash #190

Closed phuntik closed 1 year ago

phuntik commented 1 year ago

Describe the bug

IPv4 type field visualization starts with dash. 2023-09-08T16:59:55

Is it expected? Why does it work like this? I didn't find any specifications ordering to show ip addr with dash. Appreciate your reply.

Steps to reproduce

select toIPv4('127.0.0.1')

Expected behaviour

127.0.0.1

Configuration

Environment

phuntik commented 1 year ago

Also might be worth mentioning. I'm using mysql to store Metabase config. In metabase.metabase_field table there are multiple fields related to data types. I've tried to manually update some of them ipv4->string to mimic string behavior, but it didn't work either, showing dash anyways.

update metabase_field set base_type='type/Text' where id=53365;
update metabase_field set effective_type='type/Text' where id=53365;
update metabase_field set database_type='String' where id=53365;
slvrtrn commented 1 year ago

IIRC, that's how Java serializes these types by default (see InetAddress.toString). But it's easy enough to fix so it is less annoying :+1:

slvrtrn commented 1 year ago

@phuntik, fixed in https://github.com/ClickHouse/metabase-clickhouse-driver/releases/tag/1.2.2

phuntik commented 1 year ago

Thanks a lot, appreciate!