private void removeFromStructsWithUnionOrIntersection(Collection results,
      SelectResults intermediateResults, boolean isIntersection, Object[] values) {

    if (intermediateResults == null) {
      ((StructFields) results).removeFieldValues(values);
    } else {
      if (isIntersection) {
        int numOcc = ((SelectResults) results).occurrences(values);
        if (numOcc > 0) {
          ((StructFields) results).removeFieldValues(values);
          ((StructFields) intermediateResults).addFieldValues(values);

        }
      } else {
        ((StructFields) results).removeFieldValues(values);
      }
    }
  }
For local queries with distinct, deserialize all PdxInstances as we do not have a way to
compare Pdx and non Pdx objects in case the cache has a mix of pdx and non pdx objects. We
still have to honor the cache level readSerialized flag in case of all Pdx objects in cache.
Also always convert PdxString to String before adding to resultSet for remote queries
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java