Eng 5938 upsert

As there is no SQL coverage tests, may need more Junit tests.