yiguolei commented on code in PR #60367: URL: https://github.com/apache/doris/pull/60367#discussion_r2772207527
########## be/src/pipeline/exec/hierarchical_spill_partition.h: ########## @@ -0,0 +1,76 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +// A small shared helper for hierarchical spill partitioning (multi-level split). + +#pragma once + +#include <cstdint> +#include <string> + +namespace doris::pipeline { + +// Fixed 8-way fanout (3 bits per level), same as partitioned hash join spill. +// This keeps the hierarchy bounded and makes the path encoding compact and stable. +static constexpr uint32_t kSpillFanout = 8; +static constexpr uint32_t kSpillBitsPerLevel = 3; +static constexpr uint32_t kSpillMaxDepth = 6; + +struct SpillPartitionId { + uint32_t level = 0; + uint32_t path = 0; + + // Pack (level,path) into a compact key for unordered_map lookup. + // Assumes max depth is small; level is stored in high 8 bits. + uint32_t key() const { return (level << 24) | path; } Review Comment: 那这种写法,是不是限制了,我们最多2的8次方个level,然后每个level 里是2的24次方个partition? 如果是的话,对应的fe session var 需要加检查,be的代码上也需要检查 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
