public static List<TransformSpec> getPartitionTransformSpec(ASTNode node) {
    List<TransformSpec> partSpecList = new ArrayList<>();
    for (int i = 0; i < node.getChildCount(); i++) {
      TransformSpec spec = new TransformSpec();
      ASTNode child = (ASTNode) node.getChild(i);
      for (int j = 0; j < child.getChildCount(); j++) {
        ASTNode grandChild = (ASTNode) child.getChild(j);
        switch (grandChild.getToken().getType()) {
          case HiveParser.TOK_IDENTITY:
          case HiveParser.TOK_YEAR:
          case HiveParser.TOK_MONTH:
          case HiveParser.TOK_DAY:
          case HiveParser.TOK_HOUR:
            spec.setColumnName(grandChild.getChild(0).getText().toLowerCase());
            spec.setTransformType(TRANSFORMS.get(grandChild.getToken().getType()));
            break;
          case HiveParser.TOK_TRUNCATE:
          case HiveParser.TOK_BUCKET:
            spec.setTransformType(TRANSFORMS.get(grandChild.getToken().getType()));
            spec.setTransformParam(Optional.of(Integer.valueOf(grandChild.getChild(0).getText())));
            spec.setColumnName(grandChild.getChild(1).getText().toLowerCase());
            break;
        }
      }
      partSpecList.add(spec);
    }

    return partSpecList;
  }
Parse the partition transform specifications from the AST Tree node.
@param node AST Tree node, must be not null
@return list of partition transforms
ql/src/java/org/apache/hadoop/hive/ql/parse/PartitionTransform.java