@Override
  public void fromData(DataInput in,
      DeserializationContext context) throws IOException, ClassNotFoundException {
    ObjectType elementType = context.getDeserializer().readObject(in);
    collectionType = new CollectionTypeImpl(NWayMergeResults.class, elementType);
    boolean isStruct = elementType.isStructType();
    isDistinct = DataSerializer.readPrimitiveBoolean(in);
    long size = in.readLong();
    data = new ArrayList<>((int) size);
    long numLeft = size;
    while (numLeft > 0) {
      if (isStruct) {
        Object[] fields = DataSerializer.readObjectArray(in);
        data.add((E) new StructImpl((StructTypeImpl) elementType, fields));
      } else {
        E element = context.getDeserializer().readObject(in);
        data.add(element);
      }
      --numLeft;
    }
  }
The n - way merge results returns a sorted results on the cumulative sorted results for
partitioned region based query
geode-core/src/main/java/org/apache/geode/cache/query/internal/NWayMergeResults.java