Skip to content

ISSUES-2083 fix filter required with union & subquery#2094

Closed
zhang2014 wants to merge 2 commits intoClickHouse:masterfrom
zhang2014:fix/ISSUES-2083
Closed

ISSUES-2083 fix filter required with union & subquery#2094
zhang2014 wants to merge 2 commits intoClickHouse:masterfrom
zhang2014:fix/ISSUES-2083

Conversation

@zhang2014
Copy link
Copy Markdown
Contributor

#2083
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

@zhang2014 zhang2014 changed the title ISSUES-2083 fix filter required with union & subquery [WIP]ISSUES-2083 fix filter required with union & subquery Mar 23, 2018
@zhang2014 zhang2014 force-pushed the fix/ISSUES-2083 branch 4 times, most recently from 12ce7bf to 8b53fc2 Compare March 24, 2018 16:14
@zhang2014 zhang2014 changed the title [WIP]ISSUES-2083 fix filter required with union & subquery ISSUES-2083 fix filter required with union & subquery Mar 24, 2018
@zhang2014 zhang2014 changed the title ISSUES-2083 fix filter required with union & subquery [WIP] ISSUES-2083 fix filter required with union & subquery Mar 24, 2018
@zhang2014 zhang2014 force-pushed the fix/ISSUES-2083 branch 3 times, most recently from 34ffa94 to 6b8d8c3 Compare March 25, 2018 06:52
@zhang2014 zhang2014 changed the title [WIP] ISSUES-2083 fix filter required with union & subquery ISSUES-2083 fix filter required with union & subquery Mar 25, 2018
namespace DB
{

class CuttingUnionAllRequiredColumnBlockInputStream : public IProfilingBlockInputStream
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments - don't understand.

class CuttingUnionAllRequiredColumnBlockInputStream : public IProfilingBlockInputStream
{
public:
CuttingUnionAllRequiredColumnBlockInputStream(const BlockInputStreamPtr input_, const Names & required_columns);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pass by value?

* required_columns : [X,A,X]
* output_columns : [X,A,X]
*/
class CuttingUnionAllRequiredColumnBlockInputStream : public IProfilingBlockInputStream
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Interpreter cannot remove second x of second sub_union_query for

SELECT field_1,field_3,field_4 FROM (SELECT field_1,field_2,field_3,field_4 FROM table_a UNION ALL SELECT X,X,A,X FROM b);

alexey-milovidov added a commit that referenced this pull request Aug 5, 2018
alexey-milovidov added a commit that referenced this pull request Aug 5, 2018
@alexey-milovidov
Copy link
Copy Markdown
Member

Solved in different way.

c7e960b
114725b
5bce1d7
36eae15
ab96e1d

Now the test passed.
Thank you for the test case and for the reference solution!

alexey-milovidov added a commit that referenced this pull request Aug 5, 2018
alexey-milovidov added a commit that referenced this pull request Aug 5, 2018
alexey-milovidov added a commit that referenced this pull request Aug 5, 2018
This reverts commit 4755422.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants