1#include <DataTypes/DataTypeString.h>
2#include <DataTypes/DataTypesNumber.h>
3#include <Formats/FormatFactory.h>
4#include <Storages/System/StorageSystemFormats.h>
5
6namespace DB
7{
8
9NamesAndTypesList StorageSystemFormats::getNamesAndTypes()
10{
11 return {
12 {"name", std::make_shared<DataTypeString>()},
13 {"is_input", std::make_shared<DataTypeUInt8>()},
14 {"is_output", std::make_shared<DataTypeUInt8>()},
15 };
16}
17
18void StorageSystemFormats::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const
19{
20 const auto & formats = FormatFactory::instance().getAllFormats();
21 for (const auto & pair : formats)
22 {
23 const auto & [format_name, creators] = pair;
24 UInt64 has_input_format(creators.input_creator != nullptr || creators.input_processor_creator != nullptr);
25 UInt64 has_output_format(creators.output_creator != nullptr || creators.output_processor_creator != nullptr);
26 res_columns[0]->insert(format_name);
27 res_columns[1]->insert(has_input_format);
28 res_columns[2]->insert(has_output_format);
29 }
30}
31
32}
33