@Override
  void execute() throws HiveMetaException {
    String hiveVersion = schemaTool.getMetaStoreSchemaInfo().getHiveSchemaVersion();
    MetaStoreConnectionInfo connectionInfo = schemaTool.getConnectionInfo(true);
    String dbVersion = schemaTool.getMetaStoreSchemaInfo().getMetaStoreSchemaVersion(connectionInfo);

    System.out.println("Hive distribution version:\t " + hiveVersion);
    System.out.println("Metastore schema version:\t " + dbVersion);

    schemaTool.assertCompatibleVersion(hiveVersion, dbVersion);
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInfo.java