'How to load default colums while loading parquet file in snowflake

I am loading parquet file into snowflake using copy command. Parquet file has 10 column and Snowflake target table has 12 column( 2 with default dates - create date and update date)

SQL compilation error: Insert value list does not match column list expecting 12 but got 10

Is there any way i can load default values into snowflake table while loading the data through parquet file with less or more colums

any help would be greatly appreciated



Solution 1:[1]

You must give all columns in table specification. If we use only copy into table_name from (select column_names from @stage), then stage file needs to match all column present in table.

copy into <table>(<col1>,<col2>,....<col10>) from 
(select 
$1:<col_1_parq_file>::<format_specifier>,
$1:<col_2_parq_file>::<format_specifier>,
$1:<col_3_parq_file>::<format_specifier>,
.
.
.
$1:<col_10_parq_file>::<format_specifier>
from @<stage_with_parquest_file>);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pankaj