private void listPolicies() throws Exception {
    try {
      List<HdfsFileErasureCodingPolicy> erasureCodingPolicies =
          erasureCodingShim.getAllErasureCodingPolicies();
      erasureCodingPolicies.sort(nameComparator);
      if (erasureCodingPolicies.isEmpty()) {
        writeTestOutput("No EC Policies present");
      }
      for (HdfsFileErasureCodingPolicy policy : erasureCodingPolicies) {
        writeTestOutput("Policy: " + policy.getName() + " " + policy.getStatus());
      }
    } catch (Exception e) {
      throw new Exception("Cannot do language command: " + e.getMessage());
    }
  }
Comparator the compares HdfsFileErasureCodingPolicy by name.
ql/src/java/org/apache/hadoop/hive/ql/processors/ErasureProcessor.java