This will be necessary to get the distinct_resources functionality integrated with the query engine, so we can ultimately discard the legacy query eng. More discussion here: https://docs.google.com/document/d/1CiZDmVQl7jJFOXn2563fa2EyJ1__HRBdLLelumce7vI/edit#