mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Allow ExecuteScalarSubqueriesVisitor on ARRAY JOIN
This commit is contained in:
parent
19422e75b0
commit
8c2d1ec7f8
@ -63,10 +63,22 @@ bool ExecuteScalarSubqueriesMatcher::needChildVisit(ASTPtr & node, const ASTPtr
|
||||
if (node->as<ASTSelectQuery>())
|
||||
{
|
||||
/// Do not go to FROM, JOIN, UNION.
|
||||
if (child->as<ASTTableExpression>() || child->as<ASTSelectQuery>() || child->as<ASTTablesInSelectQuery>())
|
||||
if (child->as<ASTTableExpression>() || child->as<ASTSelectQuery>())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (auto tables = node->as<ASTTablesInSelectQueryElement>())
|
||||
{
|
||||
/// Contrary to what's said in the code block above, ARRAY JOIN needs to resolve the subquery if possible
|
||||
/// and assign an alias for 02367_optimize_trivial_count_with_array_join to pass. Otherwise it will fail in
|
||||
/// ArrayJoinedColumnsVisitor (`No alias for non-trivial value in ARRAY JOIN: _a`)
|
||||
/// This looks 100% as a incomplete code working on top of a bug, but this code has already been made obsolete
|
||||
/// by the new analyzer, so it's an inconvenience we can live with until we deprecate it.
|
||||
if (child == tables->array_join)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user