<commit_before>package org.lagonette.app.room.statement;

public abstract class MapPartnerStatement
        extends Statement {

    // TODO Why only 87 partners returned ??
    public static final String SQL =
            "SELECT partner.id, " +
                "partner.latitude, " +
                "partner.longitude, " +
                "partner.is_exchange_office, " +
                "partner.main_category_id, " +
                "main_category.icon " +
            "FROM partner " +
            "JOIN partner_metadata " +
                "ON partner.id = partner_metadata.partner_id " +
            "JOIN category AS main_category " +
                "ON partner.main_category_id = main_category.id " +
            "JOIN category_metadata AS main_category_metadata " +
                "ON main_category.id = main_category_metadata.category_id " +
            "LEFT JOIN partner_side_category " +
                "ON partner.id = partner_side_category.partner_id " +
            "LEFT JOIN category AS side_category " +
                "ON partner_side_category.category_id = side_category.id " +
            "LEFT JOIN category_metadata AS side_category_metadata " +
                "ON side_category.id = side_category_metadata.category_id " +
            "WHERE partner.name LIKE :search " +
                "AND partner.is_localizable <> 0 " +
            "GROUP BY partner.id " +
            "HAVING partner_metadata.is_visible > 0 " +
                "AND SUM (side_category_metadata.is_visible) > 0";

}<commit_msg>Fix map partner SQL request<commit_after>package org.lagonette.app.room.statement;

public abstract class MapPartnerStatement
        extends Statement {

    // TODO Why only 87 partners returned ??
    public static final String SQL =
            "SELECT partner.id, " +
                "partner.latitude, " +
                "partner.longitude, " +
                "partner.is_exchange_office, " +
                "partner.main_category_id, " +
                "main_category.icon " +
            "FROM partner " +
            "JOIN partner_metadata " +
                "ON partner.id = partner_metadata.partner_id " +
            "JOIN category AS main_category " +
                "ON partner.main_category_id = main_category.id " +
            "JOIN category_metadata AS main_category_metadata " +
                "ON main_category.id = main_category_metadata.category_id " +
            "LEFT JOIN partner_side_category " +
                "ON partner.id = partner_side_category.partner_id " +
            "LEFT JOIN category AS side_category " +
                "ON partner_side_category.category_id = side_category.id " +
            "LEFT JOIN category_metadata AS side_category_metadata " +
                "ON side_category.id = side_category_metadata.category_id " +
            "WHERE partner.name LIKE :search " +
                "AND partner.is_localizable <> 0 " +
            "GROUP BY partner.id " +
            "HAVING partner_metadata.is_visible + TOTAL (side_category_metadata.is_visible) > 0";

}
{'fraction_non_alphanumeric': 0.08297802558215808, 'fraction_numerical': 0.0029517874713020664, 'mean_word_length': 1.9019980970504282, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6543412', 'n_tokens_mistral': 859, 'n_tokens_neox': 805, 'n_words': 174}