private void runScript(Connection connection, Reader reader) throws SQLException, IOException {
    StringBuilder command = null;
    String line = null;
    LineNumberReader lineReader = new LineNumberReader(reader);
    while ((line = lineReader.readLine()) != null) {
      if (command == null) {
        command = new StringBuilder();
      }
      String trimmedLine = line.trim();
      if (trimmedLine.length() < 1 || trimmedLine.startsWith("--")) {
        // Do nothing, ignore blank lines and comments
      } else if (trimmedLine.endsWith(";")) {
        command.append(line, 0, line.lastIndexOf(";"));
        command.append(" ");
        Statement statement = connection.createStatement();
        LOG.debug("Running: {}", command);
        statement.execute(command.toString());
        statement.close();
        connection.commit();
        command = null;
      } else {
        command.append(line);
        command.append(" ");
      }
    }
  }
Starts a TestHiveMetastore with a provided connection pool size.

@param poolSize The number of threads in the executor pool
amoro-common/src/test/java/org/apache/amoro/hive/HMSMockServer.java