2018-07-24 14:42:52 +00:00
|
|
|
#include <DataTypes/DataTypeString.h>
|
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
2018-07-20 10:00:56 +00:00
|
|
|
#include <Formats/FormatFactory.h>
|
|
|
|
#include <Storages/System/StorageSystemFormats.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2018-07-24 14:28:56 +00:00
|
|
|
|
|
|
|
NamesAndTypesList StorageSystemFormats::getNamesAndTypes()
|
|
|
|
{
|
|
|
|
return {
|
|
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
|
|
{"is_input", std::make_shared<DataTypeUInt8>()},
|
|
|
|
{"is_output", std::make_shared<DataTypeUInt8>()},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
void StorageSystemFormats::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
|
2018-07-20 10:00:56 +00:00
|
|
|
{
|
|
|
|
const auto & formats = FormatFactory::instance().getAllFormats();
|
|
|
|
for (const auto & pair : formats)
|
|
|
|
{
|
2019-08-03 11:02:40 +00:00
|
|
|
const auto & [format_name, creators] = pair;
|
2019-10-01 10:48:46 +00:00
|
|
|
UInt64 has_input_format(creators.input_creator != nullptr || creators.input_processor_creator != nullptr);
|
2019-08-02 15:06:31 +00:00
|
|
|
UInt64 has_output_format(creators.output_creator != nullptr || creators.output_processor_creator != nullptr);
|
2019-08-03 11:02:40 +00:00
|
|
|
res_columns[0]->insert(format_name);
|
2018-07-23 16:10:57 +00:00
|
|
|
res_columns[1]->insert(has_input_format);
|
|
|
|
res_columns[2]->insert(has_output_format);
|
2018-07-20 10:00:56 +00:00
|
|
|
}
|
|
|
|
}
|
2018-07-24 14:28:56 +00:00
|
|
|
|
2018-07-20 10:00:56 +00:00
|
|
|
}
|