protected void generatePartialProgram(HepProgramBuilder programBuilder, boolean isCollection, HepMatchOrder order,
        RelOptRule... rules) {
      programBuilder.addMatchOrder(order);
      if (isCollection) {
        programBuilder.addRuleCollection(ImmutableList.copyOf(rules));
      } else {
        for (RelOptRule r : rules) {
          programBuilder.addRuleInstance(r);
        }
      }
    }
Generate a HEP program with the given rule set.

@param isCollection
@param order
@param rules
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java