mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
Fix projections with JOIN alias columns
This commit is contained in:
parent
8986de7e50
commit
240895fba7
@ -890,9 +890,10 @@ static std::unique_ptr<QueryPlan> buildJoinedPlan(
|
||||
* - in the addExternalStorage function, the JOIN (SELECT ...) subquery is replaced with JOIN _data1,
|
||||
* in the subquery_for_set object this subquery is exposed as source and the temporary table _data1 as the `table`.
|
||||
* - this function shows the expression JOIN _data1.
|
||||
* - JOIN tables will need aliases to correctly resolve USING clause.
|
||||
*/
|
||||
auto interpreter = interpretSubquery(
|
||||
join_element.table_expression, context, original_right_columns, query_options.copy().setWithAllColumns());
|
||||
join_element.table_expression, context, original_right_columns, query_options.copy().setWithAllColumns().ignoreAlias(false));
|
||||
auto joined_plan = std::make_unique<QueryPlan>();
|
||||
interpreter->buildQueryPlan(*joined_plan);
|
||||
{
|
||||
|
@ -0,0 +1,6 @@
|
||||
drop table if exists t;
|
||||
|
||||
create table t (s UInt16, l UInt16, projection p (select s, l order by l)) engine MergeTree order by s;
|
||||
|
||||
set allow_experimental_projection_optimization=1;
|
||||
select s from t join (select toUInt16(1) as s) x using (s);
|
Loading…
Reference in New Issue
Block a user