clickhousemetabase

How to add column to nested column


I have a table with nested column

...
a UInt64
b Nested (b1 String, b2 String)
c LowCardinality(String),
...

I want to update the table to be

...
a UInt64
b Nested (b1 String, b2 String, **b3 String**)
c LowCardinality(String),
...

I tried:

ALTER TABLE table_name ADD COLUMN IF NOT EXISTS b3 String AFTER b2

but I need the new column to be a part of Nested b


Solution

  • found an answer

    ALTER TABLE table_name ADD COLUMN IF NOT EXISTS b3 Array(LowCardinality(String)) AFTER b2
    

    (In my case it urls.success. *urls is the nested)