@Override
    public void execute(FunctionContext context) {
      Cache cache = context.getCache();
      QueryService queryService = cache.getQueryService();
      String qstr = (String) context.getArguments();
      try {
        Query query = queryService.newQuery(qstr);
        context.getResultSender().sendResult(
            ((SelectResults) query.execute((RegionFunctionContext) context)).asList());
        context.getResultSender().lastResult(null);
      } catch (Exception e) {
        throw new FunctionException(e);
      }
    }
Cacheserializable runnable which removes all the index on a partitioned region

@param name name of the partitioned regions
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java