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

Add query context for system logs and to Buffer #12120

Merged

Conversation

filimonov
Copy link
Contributor

@filimonov filimonov commented Jul 3, 2020

Needed to allow attaching materialized views with joins or with subqueries to system.logs or to engine=Buffer underlying table.

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

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Avoid "There is no query" exception for materialized views with joins or with subqueries attached to system logs (system.query_log, metric_log, etc) or to engine=Buffer underlying table.

Detailed description / Documentation draft:

Fixes #10437
Fixes #10285
Fixes #8670

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.
@blinkov blinkov added the pr-bugfix Pull request with bugfix, not backported by default label Jul 3, 2020
@tavplubix tavplubix self-assigned this Jul 3, 2020
@@ -161,6 +161,7 @@ class SystemLog : public ISystemLog, private boost::noncopyable
private:
/* Saving thread data */
Context & context;
Copy link
Member

Choose a reason for hiding this comment

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

It would be great to rename it to global_context and make the reference const

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing it to const - not possible for now (there are few uses of context in logs). Also kept the existing name, for now, to make backporting smoother.

src/Interpreters/SystemLog.h Outdated Show resolved Hide resolved
src/Interpreters/SystemLog.h Outdated Show resolved Hide resolved
@filimonov filimonov requested a review from tavplubix July 6, 2020 18:50
@filimonov filimonov changed the title Add query context for system logs Add query context for system logs and to Buffer Jul 6, 2020
@tavplubix tavplubix merged commit 488a8cb into ClickHouse:master Jul 7, 2020
tavplubix pushed a commit that referenced this pull request Jul 7, 2020
tavplubix pushed a commit that referenced this pull request Jul 8, 2020
…Buffer (#12243)

Co-authored-by: Alexander Tokmakov <avtokmakov@sandbox-407922969>
filimonov added a commit to filimonov/ClickHouse that referenced this pull request Jul 10, 2020
Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

Fix ClickHouse#10437, CR fixes

Sync reference file with changes in sql file

Same change for Kafka - just in case, and to make it conform.
filimonov added a commit to filimonov/ClickHouse that referenced this pull request Jul 10, 2020
Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

Fix ClickHouse#10437, CR fixes

Sync reference file with changes in sql file

Same change for Kafka - just in case, and to make it conform.
alesapin added a commit that referenced this pull request Jul 10, 2020
alesapin pushed a commit that referenced this pull request Jul 10, 2020
Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

Fix #10437, CR fixes

Sync reference file with changes in sql file

Same change for Kafka - just in case, and to make it conform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
4 participants