5758 The search condition must fully specify the Target table primary index and partition column(s) and expression must match INSERT specification primary index and partition column(s).
The search condition must fully specify an equality constraint on the primary index and partition column(s) between the source and target table. Other set of conditions must be ANDed with primary index and partition column conditions. If an expression/column is selected for the target primary index in the INSERT part of the MERGE statement, that expression must be matched with the target primary index on the ON clause. Expression should also not involve a non-deterministic UDF/UDM or RANDOM function
Correct the MERGE statement and resubmit.