-- Create table t1 in schema d1.s1, with the column definitions derived from the staged file1.parquet file.USESCHEMAd1.s1;CREATEORREPLACETABLEt1USINGTEMPLATE(SELECTARRAY_AGG(object_construct(*))FROMTABLE(INFER_SCHEMA(LOCATION=>'@mystage/file1.parquet',FILE_FORMAT=>'my_parquet_format')));-- Row data in file1.parquet.+------+------+------+| COL1 | COL2 | COL3 ||------+------+------|| a | b | c |+------+------+------+-- Describe the table.-- Note that column c2 is required in the Parquet file metadata. Therefore, the NOT NULL constraint is set for the column.DESCRIBETABLEt1;+------+-------------------+--------+-------+---------+-------------+------------+-------+------------+---------+-------------+| name | type | kind | null? | default | primary key | unique key | check | expression | comment | policy name ||------+-------------------+--------+-------+---------+-------------+------------+-------+------------+---------+-------------|| COL1 | VARCHAR(16777216) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | NULL || COL2 | VARCHAR(16777216) | COLUMN | N | NULL | N | N | NULL | NULL | NULL | NULL || COL3 | VARCHAR(16777216) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | NULL |+------+-------------------+--------+-------+---------+-------------+------------+-------+------------+---------+-------------+-- Use the SECURITYADMIN role or another role that has the global MANAGE GRANTS privilege.-- Grant the EVOLVE SCHEMA privilege to any other roles that could insert data and evolve table schema in addition to the table owner.GRANTEVOLVESCHEMAONTABLEd1.s1.t1TOROLEr1;-- Enable schema evolution on the table.-- Note that the ENABLE_SCHEMA_EVOLUTION property can also be set at table creation with CREATE OR REPLACE TABLEALTERTABLEt1SETENABLE_SCHEMA_EVOLUTION=TRUE;-- Load a new set of data into the table.-- The new data drops the NOT NULL constraint on the col2 column.-- The new data adds the new column col4.COPYINTOt1FROM@mystage/file2.parquetFILE_FORMAT=(type=parquet)MATCH_BY_COLUMN_NAME=CASE_INSENSITIVE;-- Row data in file2.parquet.+------+------+------+| col1 | COL3 | COL4 ||------+------+------|| d | e | f |+------+------+------+-- Describe the table.DESCRIBETABLEt1;+------+-------------------+--------+-------+---------+-------------+------------+-------+------------+---------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| name | type | kind | null? | default | primary key | unique key | check | expression | comment | policy name | schema evolution record ||------+-------------------+--------+-------+---------+-------------+------------+-------+------------+---------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|| COL1 | VARCHAR(16777216) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | NULL | NULL || COL2 | VARCHAR(16777216) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | NULL | {"evolutionType":"DROP_NOT_NULL","evolutionMode":"COPY","fileName":"file2.parquet","triggeringTime":"2024-03-15 23:52:59.514000000Z","queryId":"01b303b8-0808-c9ed-0000-0971491b5932"} || COL3 | VARCHAR(16777216) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | NULL | NULL || COL4 | VARCHAR(16777216) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | NULL | {"evolutionType":"ADD_COLUMN","evolutionMode":"COPY","fileName":"file2.parquet","triggeringTime":"2024-03-15 23:52:59.514000000Z","queryId":"01b303b8-0808-c9ed-0000-0971491b5932"} |+------+-------------------+--------+-------+---------+-------------+------------+-------+------------+---------+-------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-- Note that since MATCH_BY_COLUMN_NAME is set as CASE_INSENSITIVE, all column names are retrieved as uppercase letters.