mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 04:22:03 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
26 lines
709 B
C++
26 lines
709 B
C++
#include <Columns/Collator.h>
|
|
#include <Storages/System/StorageSystemCollations.h>
|
|
#include <DataTypes/DataTypeNullable.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
NamesAndTypesList StorageSystemCollations::getNamesAndTypes()
|
|
{
|
|
return {
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
{"language", std::make_shared<DataTypeNullable>(std::make_shared<DataTypeString>())},
|
|
};
|
|
}
|
|
|
|
void StorageSystemCollations::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const
|
|
{
|
|
for (const auto & [locale, lang]: AvailableCollationLocales::instance().getAvailableCollations())
|
|
{
|
|
res_columns[0]->insert(locale);
|
|
res_columns[1]->insert(lang ? *lang : Field());
|
|
}
|
|
}
|
|
|
|
}
|