79275448

Date: 2024-12-12 14:21:22
Score: 1.5
Natty:
Report link

Answer

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');

Reading material

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: iesin