Forum Discussion
thanks for the reply , i am trying resovled scd type 2 issue .
still getting this error in SNOWFLAKE scd 2 snaps : Failure: Input data contains no entry for natural key: $first_name, Reason: Input data contains no entry for natural key: $first_name, Resolution: Please check if input data has valid entries for Natural key
to implement scd 2 using snowflake , i have added one initial record in snowflake table
and then adding corresponding updated record in local file and trying to read the same updated record from file reader . i am using file reader , csv parser , mapper , snowflakescd type 2 , snowflake bulk upsert snaps .
some time it gives invalid identifier error for age column but it is resolved .
but it is not updating existing record in snowflake and it is not inserting new record into snowflake
Regards,
Mangesh
Hello @mangeshj, the first error Failure: Input data contains no entry for natural key: $first_name, Reason: Input data contains no entry for natural key: $first_name, Resolution: Please check if input data has valid entries for Natural key sounds like the input data (from the file) was missing the $first_name key. If your Snap is set to stop pipeline execution when an error occurs and just one record fails with that error, a simple step for this test pipeline would be to check the “Null safe access” box in your Mapper snap.
To clarify this sentence, are you still seeing the invalid identifier error for $age or is that completely resolved? I believe it is the latter but just want to verify.
It sounds like there is a misalignment between the input data file and the columns in Snowflake, and possibly a setting in the Mapper or either Snowflake Snap. Could you please share your pipeline and test file? If not, can you share screenshots of your Mapper and both Snowflake Snaps? Could you also show a screenshot of the table structure in Snowflake so we can see the column names?
- mangeshj5 years agoNew Contributor
Hi rsramkoski,
Attaching screen shot of the snaps and table structure and src file
person_src.txt (88 Bytes)
and this is table structure with initial one record
insert into snp_scd_usecase_Person
(id ,
first_name,
last_name,
AGE,
current_row,
start_date,
end_date)values
(5,‘Vishal’,‘Singh’,30,1,current_date-2,current_date-1)and source file has updated record with age = 32
so i want output with two records along with start date and end date
sample output expected
id name age current row
5 vishal 30 0
5 vishal 32 1please suggest
i got this error
Failure: Input data contains no entry for natural key: $first_name, Reason: Input data contains no entry for natural key: $first_name, Resolution: Please check if input data has valid entries for Natural key
but not able to resolve it .
Regards,Mangesh