code: public static boolean hasJoinOperation(String selectQuery) {
      if (selectQuery == null || selectQuery.length() == 0) {
        return false;
      }
  
      SqlParser sqlParser = SqlParser.create(selectQuery);
      try {
  
        SqlNode all = sqlParser.parseQuery();
        SqlSelect query;
        if (all instanceof SqlSelect) {
          query = (SqlSelect) all;
        } else if (all instanceof SqlOrderBy) {
          query = (SqlSelect) ((SqlOrderBy) all).query;
        } else {
          throw new UnsupportedOperationException("The select query is type of " + all.getClass() + " which is not supported here");
        }
        return query.getFrom().getKind() == SqlKind.JOIN;
      } catch (SqlParseException e) {
        return false;
      }
    }
docs: Check if the SELECT query has join operation