Close scanner for pipeline upsert select