@Override
  public void analyzeInternal(ASTNode root) throws SemanticException {
    if (root.getChildCount() < 4 || root.getChildCount() > 5) {
      throw new SemanticException("Invalid syntax for create or alter mapping.");
    }

    String resourcePlanName = unescapeIdentifier(root.getChild(0).getText());
    String entityType = root.getChild(1).getText();
    String entityName = PlanUtils.stripQuotes(root.getChild(2).getText());
    String poolPath = root.getChild(3).getType() == HiveParser.TOK_UNMANAGED ?
        null : WMUtils.poolPath(root.getChild(3)); // Null path => unmanaged
    Integer ordering = root.getChildCount() == 5 ? Integer.valueOf(root.getChild(4).getText()) : null;

    DDLDesc desc = getDesc(resourcePlanName, entityType, entityName, poolPath, ordering);
    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc)));

    DDLUtils.addServiceOutput(conf, getOutputs());
  }
Abstract ancestor of Create and Alter WM Mapping analyzers.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/mapping/AbstractVMMappingAnalyzer.java