public static Map<String, String> getPartSpec(ASTNode node) {
    if (node == null) {
      return null;
    }

    Map<String, String> partSpec = new LinkedHashMap<>();
    for (int i = 0; i < node.getChildCount(); ++i) {
      ASTNode child = (ASTNode) node.getChild(i);
      String key = child.getChild(0).getText();
      String val = null;
      if (child.getChildCount() > 1) {
        val = stripQuotes(child.getChild(1).getText());
      }
      partSpec.put(key.toLowerCase(), val);
    }
    return partSpec;
  }
Get the partition specs from the tree.

@param ast
         Tree to extract partitions from.
@return A list of partition name to value mappings.
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java