1 | #include <Common/Macros.h> |
---|---|
2 | #include <Interpreters/Context.h> |
3 | #include <Storages/System/StorageSystemMacros.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | NamesAndTypesList StorageSystemMacros::getNamesAndTypes() |
10 | { |
11 | return { |
12 | {"macro", std::make_shared<DataTypeString>()}, |
13 | {"substitution", std::make_shared<DataTypeString>()}, |
14 | }; |
15 | } |
16 | |
17 | void StorageSystemMacros::fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo &) const |
18 | { |
19 | auto macros = context.getMacros(); |
20 | |
21 | for (const auto & macro : macros->getMacroMap()) |
22 | { |
23 | res_columns[0]->insert(macro.first); |
24 | res_columns[1]->insert(macro.second); |
25 | } |
26 | } |
27 | |
28 | } |
29 |