Skip to content

FR: configurable set of supported languages #154

Closed

Description

@Abzac

Limited geobase languages support causes failure while trying to load dictionaries when not all the supported language files exists.

So, when you don't have regions_names_*.txt files for all the languages, dictionaries loading for region_names fails, and you get no languages at all.

In file https://github.com/yandex/ClickHouse/blob/f9eb536825ae3cfab65b1d8d37a2bdd67c58010d/dbms/include/DB/Dictionaries/Embedded/RegionsNames.h There are no errors checks for the cases when some of the language files doesn't exist.

        for (size_t language_id = 0; language_id < SUPPORTED_LANGUAGES_COUNT; ++language_id)
        {
            const std::string & language = getSupportedLanguages()[language_id];
            std::string path = directory + "/regions_names_" + language + ".txt";

            Poco::File file(path);

So, I should have a file for every language, even I don't need it (at least empty one).

Also, languages list is strictly fixed to

{ "ru", "en", "ua", "by", "kz", "tr" }

but why can't I use some other languages, or even other suffixes? It's easy. Moreover, this mechanism is already implemented in "regions_hierarchy" dictionary, cause it looks for any files in the directory with specified kinda mask (looking for files with the same name + suffixes).

Moreover, we have some inconsistent config files because of that.

<!-- Path to file with region hierarchy. -->
<path_to_regions_hierarchy_file>/opt/geo/regions_hierarchy.txt</path_to_regions_hierarchy_file>
<!-- Path to directory with files containing names of regions -->
<path_to_regions_names_files>/opt/geo</path_to_regions_names_files>

So, in the first case we have some kind of mask, while in the second case we have a path and fixed file names in it. Please see

const std::string & language = getSupportedLanguages()[language_id];
std::string path = directory + "/regions_names_" + language + ".txt";

Moreover, configuration format for external dictionaries differs too. It is a file mask with asterisks.

<!-- Configuration of external dictionaries. See: https://clickhouse.yandex/reference_en.html#External%20Dictionaries
-->
<dictionaries_config>*_dictionary.xml</dictionaries_config>

Do you have any plans about making dictionary file masks for config files more consistent and flexible?

Activity

  1. changed the title [-]Limited geobase languages support causes failure while trying to load when not all the support languages files exists[/-] [+]Limited geobase languages support causes failure while trying to load dictionaries when not all the support languages files exists[/+] on Oct 27, 2016
  2. changed the title [-]Limited geobase languages support causes failure while trying to load dictionaries when not all the support languages files exists[/-] [+]Limited geobase languages support causes failure while trying to load dictionaries when not all the supported languages files exists[/+] on Oct 27, 2016
  3. changed the title [-]Limited geobase languages support causes failure while trying to load dictionaries when not all the supported languages files exists[/-] [+]Limited geobase languages support causes failure while trying to load dictionaries when not all the supported language files exists[/+] on Oct 27, 2016
  4. changed the title [-]Limited geobase languages support causes failure while trying to load dictionaries when not all the supported language files exists[/-] [+]Problems with external dictionaries, geobase, and etc[/+] on Nov 14, 2016
  5. changed the title [-]Problems with external dictionaries, geobase, and etc[/-] [+]FR: configurable set of supported languages[/+] on Jul 26, 2018
  6. added
    st-accepted
    on Nov 29, 2019
  7. alexey-milovidov commented on Mar 30, 2020

    @alexey-milovidov
    Member

    This task is easy to do but there is very low demand for this feature.

  8. removed
    st-accepted
    on Mar 30, 2020
  9. added
    not planned
    on Oct 26, 2021
  10. added 2 commits that reference this issue on Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementfeatureminornot planned

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions