First, create a table automatically inferring the schema from staged files.
create table mytable using template (
select array_agg(object_construct(*))
from table(
infer_schema(
location => '@my_stage',
file_format => 'my_format'
)
)
);
Now, use COPY INTO <table>
command to load the data.
copy into mytable
from @my_stage
file_format = (format_name = 'parquet_format');