Preserve context for joins while merging relations