public void getAlterTableStmtForeignKeyConstraint(ForeignKeyInfo fr, List<String> constraints) {
    if (!ForeignKeyInfo.isNotEmpty(fr)) {
      return;
    }
    Map<String, List<ForeignKeyInfo.ForeignKeyCol>> all = fr.getForeignKeys();
    for (String key : all.keySet()) {
      List<ForeignKeyInfo.ForeignKeyCol> fkCols = all.get(key);
      Set<String> parentCols = new LinkedHashSet<>(fkCols.size());
      Set<String> childCols = new LinkedHashSet<>(fkCols.size());

      for (ForeignKeyInfo.ForeignKeyCol fkc: fkCols) {
        parentCols.add(fkc.parentColName);
        childCols.add(fkc.childColName);
      }
      ST command = new ST(ALTER_TABLE_ADD_FOREIGN_KEY);
      command.add(CHILD_TABLE_NAME, unparseIdentifier(fr.getChildTableName()));
      command.add(DATABASE_NAME, unparseIdentifier(fr.getChildDatabaseName()));
      command.add(CONSTRAINT_NAME, unparseIdentifier(key));
      command.add(CHILD_COL_NAME, unparseListOfIdentifiersAndJoin(childCols, ", "));
      command.add(DATABASE_NAME_FR, unparseIdentifier(fkCols.get(0).parentDatabaseName));
      command.add(PARENT_TABLE_NAME, unparseIdentifier(fkCols.get(0).parentTableName));
      command.add(PARENT_COL_NAME, unparseListOfIdentifiersAndJoin(parentCols, ", "));
      command.add(ENABLE, fkCols.get(0).enable);
      command.add(VALIDATE, fkCols.get(0).validate);
      command.add(RELY, fkCols.get(0).rely);
      constraints.add(command.render());
    }
  }
Parses the basic table statistics for the given table.

@param tbl
@return Returns the alter table .... update statistics for table
ql/src/java/org/apache/hadoop/hive/ql/exec/DDLPlanUtils.java