ClickHouse/src/Storages/System/StorageSystemCollations.cpp

26 lines
704 B
C++
Raw Normal View History

#include <Columns/Collator.h>
#include <Storages/System/StorageSystemCollations.h>
2019-12-06 22:22:12 +00:00
#include <DataTypes/DataTypeNullable.h>
namespace DB
{
NamesAndTypesList StorageSystemCollations::getNamesAndTypes()
{
return {
{"name", std::make_shared<DataTypeString>()},
2019-12-06 22:22:12 +00:00
{"language", std::make_shared<DataTypeNullable>(std::make_shared<DataTypeString>())},
};
}
void StorageSystemCollations::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
{
2019-12-05 15:31:45 +00:00
for (const auto & [locale, lang]: AvailableCollationLocales::instance().getAvailableCollations())
{
res_columns[0]->insert(locale);
2019-12-06 22:22:12 +00:00
res_columns[1]->insert(lang ? *lang : Field());
2019-12-05 15:31:45 +00:00
}
}
}