mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
fixed ASTInterpolateElement::clone, fixed QueryNormalizer to exclude ASTInterpolateElement::children
This commit is contained in:
parent
7dbe8bc2dc
commit
64dcddc6e3
@ -888,7 +888,7 @@ static InterpolateDescriptionPtr getInterpolateDescription(
|
||||
col_set.insert(column.name);
|
||||
}
|
||||
for (const auto & column : result_block)
|
||||
if( col_set.count(column.name) == 0)
|
||||
if (col_set.count(column.name) == 0)
|
||||
source_columns.emplace_back(column.name, column.type);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <Parsers/ASTSelectQuery.h>
|
||||
#include <Parsers/ASTQueryParameter.h>
|
||||
#include <Parsers/ASTTablesInSelectQuery.h>
|
||||
#include <Parsers/ASTInterpolateElement.h>
|
||||
#include <Common/StringUtils/StringUtils.h>
|
||||
#include <Common/quoteString.h>
|
||||
#include <IO/WriteHelpers.h>
|
||||
@ -134,7 +135,7 @@ void QueryNormalizer::visit(ASTTablesInSelectQueryElement & node, const ASTPtr &
|
||||
|
||||
static bool needVisitChild(const ASTPtr & child)
|
||||
{
|
||||
return !(child->as<ASTSelectQuery>() || child->as<ASTTableExpression>());
|
||||
return !(child->as<ASTSelectQuery>() || child->as<ASTTableExpression>() || child->as<ASTInterpolateElement>());
|
||||
}
|
||||
|
||||
/// special visitChildren() for ASTSelectQuery
|
||||
|
@ -47,7 +47,7 @@ bool RequiredSourceColumnsMatcher::needChildVisit(const ASTPtr & node, const AST
|
||||
return false;
|
||||
|
||||
/// Processed. Do not need children.
|
||||
if (node->as<ASTTableExpression>() || node->as<ASTArrayJoin>() || node->as<ASTSelectQuery>())
|
||||
if (node->as<ASTTableExpression>() || node->as<ASTArrayJoin>() || node->as<ASTSelectQuery>() || node->as<ASTInterpolateElement>())
|
||||
return false;
|
||||
|
||||
if (const auto * f = node->as<ASTFunction>())
|
||||
|
@ -17,8 +17,9 @@ public:
|
||||
ASTPtr clone() const override
|
||||
{
|
||||
auto clone = std::make_shared<ASTInterpolateElement>(*this);
|
||||
clone->cloneChildren();
|
||||
clone->expr = clone->expr->clone();
|
||||
clone->children.clear();
|
||||
clone->children.push_back(clone->expr);
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user