Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from

Conversation

zhang2014
Copy link
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
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
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
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
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