Description
The issue is in Join candidates of the kind Join[Union[a,b]; Union[a,c]]. If the instance of a is shared in different trees of a JoinCandidate, the rewritten query will be wrong. JoinCandidate's children set exclusive measure phrase indices, and that is done via retain method of list. So let's say union1 is answering [0,1] measures and union2 is answering [2,3] measures, and since [0,1,2,3].retain([0,1]).retain([2,3]) == [], it ends up answering no measures at all