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-2906 support join for table function #2907

Conversation

zhang2014
Copy link
Contributor

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

@zhang2014 zhang2014 force-pushed the feature/support_join_for_table_function branch 2 times, most recently from 9771371 to 7499196 Compare August 21, 2018 07:24
select_expression_list->children.reserve(columns.size());
if (function)
{
const auto & storage = const_cast<Context *>(&context)->executeTableFunction(table_expression);
Copy link
Member

Choose a reason for hiding this comment

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

That looks suspicious.
We need to either make function executeTableFunction const or figure out why it is non const and maybe change context in Expression analyzer to non-const and proove that nobody rely on it being const.

Copy link
Contributor Author

@zhang2014 zhang2014 Aug 24, 2018

Choose a reason for hiding this comment

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

👍
Indeed, the correct way to call it is context->getQueryContext()->executeTableFunction. Because executeTableFunction method always cache the current execution results. direct call to context->executeTableFunction could be a memory leak.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zhang2014 zhang2014 force-pushed the feature/support_join_for_table_function branch from 7499196 to 83ceeca Compare August 24, 2018 07:09
@alexey-milovidov alexey-milovidov merged commit 64b48b5 into ClickHouse:master Sep 1, 2018
@alexey-milovidov
Copy link
Member

Ok.

PS. Non-obvious usage of Context remains as technical debt.

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