How to add column to nested column

200 Views Asked by At

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

1

There are 1 best solutions below

0
D.A On BEST ANSWER

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)