sqlnullableclickhouse

Clickhouse create from select set the value to 0 when given null for a nullable(Int8) column


I am trying to create a table in ClickHouse with the following SQL

CREATE TABLE stage.test_int_null (
    is_active Nullable(Int8),
    name String
) ENGINE = MergeTree()
ORDER BY (tuple()) AS
select null as is_active,
    'test' as name

I expected the table should be:

is_active name
null test

Actually I got

is_active name
0 test

I checked the doc and cannot find why is_acitve is set to 0 rather than null. Any suggestion?

Update: Not a Clickhouse issue, it is Metabase WebUI that displays it to 0. enter image description here


Solution

  • It doesn't appear in the latest version, should be fixed now. Test here, where you can check with different versions.