public void deleteDatasetVersionForDatasetDelete(int accountId, int containerId, String datasetName, String version)
      throws SQLException, AccountServiceException {
    try {
      long startTimeMs = System.currentTimeMillis();
      PreparedStatement getVersionSchemaStatement = dataAccessor.getPreparedStatement(getVersionSchemaSql, true);
      Dataset.VersionSchema versionSchema =
          executeGetVersionSchema(getVersionSchemaStatement, accountId, containerId, datasetName);
      PreparedStatement deleteDatasetVersionStatement =
          dataAccessor.getPreparedStatement(deleteDatasetVersionForDatasetDeleteByIdSql, true);
      long versionValue = getVersionBasedOnSchema(version, versionSchema);
      executeDeleteDatasetVersionForDatasetDeleteStatement(deleteDatasetVersionStatement, accountId, containerId,
          datasetName, versionValue);
      dataAccessor.onSuccess(Delete, System.currentTimeMillis() - startTimeMs);
    } catch (SQLException | AccountServiceException e) {
      dataAccessor.onException(e, Delete);
      throw e;
    }
  }
Delete a dataset version for dataset deletion.
@param accountId the id for the parent account.
@param containerId the id of the container.
@param datasetName the name of the dataset.
@param version the version of the dataset.
@throws SQLException
@throws AccountServiceException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java