### Describe the problem <!-- Describe the problem clearly here. --> Since query compilers may perform `merge` operation differently, it is necessary move out all related logic from API layer into the query compiler.