mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #63983 from ClickHouse/fix-limit-by-skip-usunsed-shards
Limit by and skip_unused_shards with analyzer
This commit is contained in:
commit
91066aeace
@ -584,7 +584,7 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo
|
|||||||
* otherwise coordinator does not find it in block.
|
* otherwise coordinator does not find it in block.
|
||||||
*/
|
*/
|
||||||
NameSet required_output_nodes_names;
|
NameSet required_output_nodes_names;
|
||||||
if (sort_analysis_result_optional.has_value() && !planner_query_processing_info.isSecondStage())
|
if (sort_analysis_result_optional.has_value() && planner_query_processing_info.isFirstStage() && planner_query_processing_info.getToStage() != QueryProcessingStage::Complete)
|
||||||
{
|
{
|
||||||
const auto & before_order_by_actions = sort_analysis_result_optional->before_order_by_actions;
|
const auto & before_order_by_actions = sort_analysis_result_optional->before_order_by_actions;
|
||||||
for (const auto & output_node : before_order_by_actions->getOutputs())
|
for (const auto & output_node : before_order_by_actions->getOutputs())
|
||||||
|
@ -34,3 +34,6 @@ select * from dist_01757 where dummy in (0, 1) settings optimize_skip_unused_sha
|
|||||||
select * from dist_01757 where dummy in (0, 1) settings optimize_skip_unused_shards_limit=9223372036854775808; -- { serverError 69 }
|
select * from dist_01757 where dummy in (0, 1) settings optimize_skip_unused_shards_limit=9223372036854775808; -- { serverError 69 }
|
||||||
|
|
||||||
drop table dist_01757;
|
drop table dist_01757;
|
||||||
|
|
||||||
|
-- fuzzed
|
||||||
|
SELECT * FROM remote('127.0.0.{1,2}', numbers(40), number) ORDER BY 'a' LIMIT 1 BY number SETTINGS optimize_skip_unused_shards = 1, force_optimize_skip_unused_shards=0 format Null
|
||||||
|
Loading…
Reference in New Issue
Block a user