Repository navigation
Inline VIEW subquery during query analysis - #100830
Conversation
|
Workflow [PR], commit [731eb3f] Summary: ❌
AI ReviewSummaryThis PR adds experimental setting Missing context
Findings❌ Blockers
Tests
ClickHouse Rules
Performance & SafetyInlining can improve plans, but semantic drift for Final Verdict
|
| { | ||
| for (size_t i = 0; i < view_columns.size(); ++i) | ||
| { | ||
| if (!view_columns[i].type->equals(*subquery_columns[i].type)) |
There was a problem hiding this comment.
Will it work for subcolumns as well?
It's probably possible to get a subcolumn of the same type, e.g., for JSON.
| } | ||
|
|
||
| auto wrapper_context = Context::createCopy(scope.context); | ||
| auto wrapper_query = std::make_shared<QueryNode>(std::move(wrapper_context)); |
There was a problem hiding this comment.
I also think we can only have one query node for renames, type conversions and row policy filter
LLVM Coverage Report
Changed lines: 96.15% (150/156) · Uncovered code |
…view Inline VIEW subquery during query analysis
…to 26.3 Resolve the conflict in `StorageView.cpp` and reconcile the change with 26.3: - 26.3 does not have `Context::isViewInnerQuery` (added on master by #94359, not backported). Add the `is_view_inner_query` flag to `Context` and set it in `getViewContext` of `StorageView`, so the inner query of an ordinary view reads the table itself, not the inserted block of a materialized view. - 26.3 does not have view inlining in the analyzer (`StorageView::getViewSubqueryContext`, `analyzer_inline_views`, from #100830). Drop that part and the test `05293_mv_ordinary_view_over_source_inlined`. - Use `QueryNode::getJoinTree` instead of `getJoinTreeNodeTyped`, which does not exist in 26.3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Inline VIEW subquery in the query tree to allow more optimisations to be applied to the VIEW.
Documentation entry for user-facing changes
Version info
26.4.1.566