@Override
  public String generateInitFileName(String toVersion) throws HiveMetaException {
    if (toVersion == null) {
      toVersion = getHiveSchemaVersion();
    }
    String initScriptName = INIT_FILE_PREFIX + toVersion + "." +
        dbType + SQL_FILE_EXTENSION;
    // check if the file exists
    File file = new File(getMetaStoreScriptDir() + File.separatorChar +
          initScriptName);
    if (!file.exists()) {
      throw new HiveMetaException("Unknown version specified for initialization: " + toVersion,
          new NoSuchFileException(file.getAbsolutePath()));
    }
    return initScriptName;
  }
Get the name of the script to initialize the schema for given version
@param toVersion Target version. If it's null, then the current server version is used
@return
@throws HiveMetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java