code: public TupleMRConfig buildConf() throws TupleMRException {
      failIfEmpty(schemas, " Need to declare at least one intermediate schema");
      failIfEmpty(groupByFields, " Need to declare group by fields");
  
      TupleMRConfig conf = new TupleMRConfig();
      conf.setIntermediateSchemas(schemas);
      conf.setSchemaFieldAliases(fieldAliases);
      conf.setGroupByFields(groupByFields);
      conf.setRollupFrom(rollupFrom);
      if (fieldsToPartition != null && fieldsToPartition.length != 0) {
        conf.setCustomPartitionFields(Arrays.asList(fieldsToPartition));
      }
  
      Criteria convertedCommonOrder = convertCommonSortByToCriteria(commonOrderBy);
      if (commonOrderBy != null && commonOrderBy.getSchemaOrder() != null) {
        conf.setSourceOrder(commonOrderBy.getSchemaOrder());
      } else {
        conf.setSourceOrder(Order.ASC);// by default source order is ASC
      }
      conf.setCommonCriteria(convertedCommonOrder);
      if (commonOrderBy != null) {
        Map<String, Criteria> convertedParticularOrderings = getSecondarySortBys(
            commonOrderBy, schemas, specificsOrderBy);
        for (Map.Entry<String, Criteria> entry : convertedParticularOrderings.entrySet()) {
          conf.setSecondarySortBy(entry.getKey(), entry.getValue());
        }
      }
  
  
      return conf;
    }
docs: Creates a brand new and immutable {@link TupleMRConfig} instance.