mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #4363 from 4ertus2/ast
Fix full/right join 'different number of columns'
This commit is contained in:
commit
e762f370a7
@ -1207,7 +1207,8 @@ private:
|
||||
for (size_t i = 0; i < right_sample_block.columns(); ++i)
|
||||
{
|
||||
const ColumnWithTypeAndName & src_column = right_sample_block.getByPosition(i);
|
||||
result_sample_block.insert(src_column.cloneEmpty());
|
||||
if (!result_sample_block.has(src_column.name))
|
||||
result_sample_block.insert(src_column.cloneEmpty());
|
||||
}
|
||||
|
||||
const auto & key_names_right = parent.key_names_right;
|
||||
|
@ -0,0 +1,8 @@
|
||||
1 x x
|
||||
1 x x
|
||||
1 x x
|
||||
1 x x
|
||||
1 x x
|
||||
1 x x
|
||||
1 x x
|
||||
1 x x
|
@ -0,0 +1,9 @@
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) join (SELECT 1 as a, 'y' as b) using a;
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) left join (SELECT 1 as a, 'y' as b) using a;
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) full join (SELECT 1 as a, 'y' as b) using a;
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) right join (SELECT 1 as a, 'y' as b) using a;
|
||||
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) any join (SELECT 1 as a, 'y' as b) using a;
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) any left join (SELECT 1 as a, 'y' as b) using a;
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) any full join (SELECT 1 as a, 'y' as b) using a;
|
||||
SELECT * FROM (SELECT 1 AS a, 'x' AS b) any right join (SELECT 1 as a, 'y' as b) using a;
|
Loading…
Reference in New Issue
Block a user