I ingest data into a table source_table
with AVRO data. There is a column in this table say "avro_data"
which will be populated with variant data.
I plan to copy data into a structured table target_table
where columns have the same name and datatype as the avro_data
fields in the source table.
Example:
select avro_data from source_table
{"C1":"V1", "C2", "V2"}
This will result in
select * from target_table
------------
| C1 | C2 |
------------
| V1 | V2 |
------------
My question is when schema of the avro_data
evolves and new fields get added, how can I keep schema of the target_table
in sync by adding equivalent columns in the target table?
Is there anything out of the box in snowflake to achieve this or if someone has created any code to do something similar?