There are two columns in Database Table (Key and TimeStamp).
Lets assume, there are three rows in the data set with same Key but with different timestamp. The dataset is sorted based on Timestamp.
If the Upsert on the table is executed on this data set, will the last row(with latest timestamp - because of order by) be there in the database table or the execution order is not guaranteed?