public static List<Object[]> makeOrderSpecs(String order) {
    if (StringUtils.isBlank(order) || order.split(":").length != 2) {
      return new ArrayList<Object[]>();
    }
    String[] parts = order.split(":");
    String[] poses = parts[0].split(",");
    char[] chars = parts[1].toCharArray();
    List<Object[]> orderSpecs = new ArrayList<Object[]>(chars.length);
    if (poses.length != chars.length) {
      throw new IllegalArgumentException("The length of partition keys and sort order" +
          " do not mismatch, order: " + order);
    }
    for (int i = 0; i < poses.length; i++) {
      Object[] spec = new Object[2];
      spec[0] = Integer.parseInt(poses[i]);
      spec[1] = ('+' == chars[i]) ? "ASC" : "DESC";
      orderSpecs.add(spec);
    }
    return orderSpecs;
  }
Get order specs from a represented string.
@param order specified in partColIndex[,partColIndex]*:[-|\+]+ pattern
@return the order specs
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java