public static void validateLateralView(ASTNode lateralView) throws SemanticException {
    if (lateralView.getChildCount() != 2) {
      throw new SemanticException("Token Lateral View contains " + lateralView.getChildCount() +
          " children.");
    }
    ASTNode next = (ASTNode) lateralView.getChild(1);
    if (!TABLE_ALIAS_TOKEN_TYPES.contains(next.getToken().getType()) &&
          HiveParser.TOK_LATERAL_VIEW != next.getToken().getType()) {
        throw new SemanticException(ASTErrorUtils.getMsg(
            ErrorMsg.LATERAL_VIEW_INVALID_CHILD.getMsg(), lateralView));
    }
  }
LateralViewPlan is a helper class holding the objects needed for generating a Calcite
plan from an ASTNode. The object is to be generated when a LATERAL_VIEW token is detected.
From the ASTNode and relevant input node information, the following objects are created:
* A HiveTableFunctionScan RelNode
* A RowResolver containing the row resolving information output from the RelNode
* The table alias for the table generated by the UDTF and Lateral View
ql/src/java/org/apache/hadoop/hive/ql/parse/relnodegen/LateralViewPlan.java