ClickHouse/src/Core/InterpolateDescription.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.0 KiB
C++
Raw Normal View History

#include <Core/Block.h>
#include <IO/Operators.h>
#include <Common/JSONBuilder.h>
#include <Core/InterpolateDescription.h>
2022-03-19 06:41:12 +00:00
#include <Interpreters/convertFieldToType.h>
namespace DB
{
2022-03-30 20:34:19 +00:00
InterpolateDescription::InterpolateDescription(ActionsDAGPtr actions_, const Aliases & aliases)
: actions(actions_)
{
2022-03-30 20:34:19 +00:00
for (const auto & name_type : actions->getRequiredColumns())
2022-03-28 23:15:53 +00:00
{
if (const auto & p = aliases.find(name_type.name); p != aliases.end())
required_columns_map[p->second->getColumnName()] = name_type;
else
required_columns_map[name_type.name] = name_type;
}
2022-03-30 20:34:19 +00:00
for (const ColumnWithTypeAndName & column : actions->getResultColumns())
2022-03-28 23:15:53 +00:00
{
2022-03-31 15:51:13 +00:00
std::string name = column.name;
if (const auto & p = aliases.find(name); p != aliases.end())
name = p->second->getColumnName();
result_columns_set.insert(name);
result_columns_order.push_back(name);
2022-03-28 23:15:53 +00:00
}
}
}