private int compareVersion(String dbVerPart, String hiveVerPart) {
    if (dbVerPart.equals(hiveVerPart)) {
      return 0;
    }
    boolean isDbVerNum = StringUtils.isNumeric(dbVerPart);
    boolean isHiveVerNum = StringUtils.isNumeric(hiveVerPart);
    if (isDbVerNum && isHiveVerNum) {
      return Integer.parseInt(dbVerPart) - Integer.parseInt(hiveVerPart);
    } else if (!isDbVerNum && !isHiveVerNum) {
      return dbVerPart.compareTo(hiveVerPart);
    }
    // return -1 for one is a number but the other is a string
    return -1;
  }
Find the directory of metastore scripts
@return
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java