mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Fix more tests.
This commit is contained in:
parent
a8b1b11ee6
commit
20d673a206
@ -1215,35 +1215,14 @@ QueryPlan ReadFromMerge::createPlanForTable(
|
||||
if (real_column_names.empty())
|
||||
real_column_names.push_back(ExpressionActions::getSmallestColumn(storage_snapshot_->metadata->getColumns().getAllPhysical()).name);
|
||||
|
||||
StorageView * view = dynamic_cast<StorageView *>(storage.get());
|
||||
if (!view || allow_experimental_analyzer)
|
||||
{
|
||||
storage->read(plan,
|
||||
real_column_names,
|
||||
storage_snapshot_,
|
||||
modified_query_info,
|
||||
modified_context,
|
||||
processed_stage,
|
||||
max_block_size,
|
||||
UInt32(streams_num));
|
||||
}
|
||||
else
|
||||
{
|
||||
/// For view storage, we need to rewrite the `modified_query_info.view_query` to optimize read.
|
||||
/// The most intuitive way is to use InterpreterSelectQuery.
|
||||
|
||||
/// Intercept the settings
|
||||
modified_context->setSetting("max_threads", streams_num);
|
||||
modified_context->setSetting("max_streams_to_max_threads_ratio", 1);
|
||||
modified_context->setSetting("max_block_size", max_block_size);
|
||||
|
||||
InterpreterSelectQuery interpreter(modified_query_info.query,
|
||||
modified_context,
|
||||
storage,
|
||||
view->getInMemoryMetadataPtr(),
|
||||
SelectQueryOptions(processed_stage));
|
||||
interpreter.buildQueryPlan(plan);
|
||||
}
|
||||
storage->read(plan,
|
||||
real_column_names,
|
||||
storage_snapshot_,
|
||||
modified_query_info,
|
||||
modified_context,
|
||||
processed_stage,
|
||||
max_block_size,
|
||||
UInt32(streams_num));
|
||||
|
||||
if (!plan.isInitialized())
|
||||
return {};
|
||||
|
@ -7,6 +7,9 @@ Expression ((Projection + Before ORDER BY))
|
||||
Aggregating
|
||||
Expression (Before GROUP BY)
|
||||
ReadFromMerge
|
||||
ReadFromMergeTree (default.mt1)
|
||||
ReadFromMergeTree (default.mt2)
|
||||
ReadFromStorage (TinyLog)
|
||||
Expression
|
||||
ReadFromMergeTree (default.mt1)
|
||||
Expression
|
||||
ReadFromMergeTree (default.mt2)
|
||||
Expression
|
||||
ReadFromStorage (TinyLog)
|
||||
|
Loading…
Reference in New Issue
Block a user