private boolean checkIfTableIsUsable(String tableName, boolean configValue) {
    if (!configValue) {
      // don't check it if disabled
      return false;
    }
    jdbcResource.bindDataSource(POOL_TX);
    try {
      jdbcResource.getJdbcTemplate().query("SELECT 1 FROM \"" + tableName + "\"",
          new MapSqlParameterSource(), ResultSet::next);
    } catch (DataAccessException e) {
      LOG.debug("Catching sql exception in " + tableName + " check", e);
      if (e.getCause() instanceof SQLException) {
        if (dbProduct.isTableNotExistsError(e)) {
          return false;
        } else {
          throw new RuntimeException(
              "Unable to select from transaction database: " + SqlRetryHandler.getMessage(e) + StringUtils.stringifyException(e));
        }
      }
    } finally {
      jdbcResource.unbindDataSource();
    }
    return true;
  }
Check if provided table is usable
@return
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java