Tree partSpecTree = ast.getChild(childIndex);
if (partSpecTree.getType() == HiveParser.TOK_PARTSPEC) {
PartitionSpec partSpec = new PartitionSpec();
for (int i = 0; i < partSpecTree.getChildCount(); ++i) {
CommonTree partSpecSingleKey = (CommonTree) partSpecTree.getChild(i);
assert (partSpecSingleKey.getType() == HiveParser.TOK_PARTVAL);
String key = partSpecSingleKey.getChild(0).getText().toLowerCase();
String operator = partSpecSingleKey.getChild(1).getText();
String val = partSpecSingleKey.getChild(2).getText();
partSpec.addPredicate(key, operator, val);
}
partSpecList.add(partSpec);
}