mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 02:52:13 +00:00
Fix scalars for MV.
This commit is contained in:
parent
e41e998f4a
commit
abef634d1f
@ -93,6 +93,10 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream(
|
||||
views.emplace_back(ViewInfo{std::move(query), database_table, std::move(out)});
|
||||
}
|
||||
|
||||
/// Remove calculated scalar subquery results, because they can be calculated for real, not substituted tables.
|
||||
if (views_context->hasQueryContext())
|
||||
views_context->getQueryContext().dropScalars();
|
||||
|
||||
/// Do not push to destination table if the flag is set
|
||||
if (!no_destination)
|
||||
{
|
||||
|
@ -885,6 +885,12 @@ bool Context::hasScalar(const String & name) const
|
||||
}
|
||||
|
||||
|
||||
void Context::dropScalars()
|
||||
{
|
||||
scalars.clear();
|
||||
}
|
||||
|
||||
|
||||
StoragePtr Context::executeTableFunction(const ASTPtr & table_expression)
|
||||
{
|
||||
/// Slightly suboptimal.
|
||||
|
@ -330,6 +330,7 @@ public:
|
||||
const Block & getScalar(const String & name) const;
|
||||
void addScalar(const String & name, const Block & block);
|
||||
bool hasScalar(const String & name) const;
|
||||
void dropScalars();
|
||||
|
||||
StoragePtr executeTableFunction(const ASTPtr & table_expression);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user