case HiveParser.TOK_PARTSPEC:
if(currentPart != null) {
AddPartitionDesc addPartitionDesc =
new AddPartitionDesc(MetaStoreUtils.DEFAULT_DATABASE_NAME,
tblName, currentPart, currentLocation);
rootTasks.add(TaskFactory.get(new DDLWork(addPartitionDesc), conf));
}
//create new partition, set values
currentLocation = null;
currentPart = partIter.next();
break;
case HiveParser.TOK_PARTITIONLOCATION:
//if location specified, set in partition
currentLocation = unescapeSQLString(child.getChild(0).getText());
break;
default:
throw new SemanticException("Unknown child: " + child);
}
}
//add the last one
if(currentPart != null) {
AddPartitionDesc addPartitionDesc =
new AddPartitionDesc(MetaStoreUtils.DEFAULT_DATABASE_NAME,
tblName, currentPart, currentLocation);
rootTasks.add(TaskFactory.get(new DDLWork(addPartitionDesc), conf));
}
}