suxiaogang223 commented on code in PR #66685:
URL: https://github.com/apache/doris/pull/66685#discussion_r3781941016


##########
be/src/exec/partitioner/external/external_table_sink_hash_partitioner.cpp:
##########
@@ -0,0 +1,143 @@
+// 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.
+
+#include "exec/partitioner/external/external_table_sink_hash_partitioner.h"
+
+#include <limits>
+#include <utility>
+
+#include "common/cast_set.h"
+#include "common/config.h"
+#include "common/status.h"
+#include "exec/partitioner/external/external_partition_function_factory.h"
+
+namespace doris {
+#include "common/compile_check_begin.h"
+
+namespace {
+Status logical_partition_count(uint32_t writer_count,
+                               TExternalTableSinkWriterAssignment::type 
assignment,
+                               uint32_t* result) {
+    if (writer_count == 0) {
+        return Status::InvalidArgument("External sink writer count must be 
positive");
+    }
+    if (assignment != TExternalTableSinkWriterAssignment::SKEWED) {
+        *result = writer_count;
+        return Status::OK();
+    }
+    const uint32_t partitions_per_writer = static_cast<uint32_t>(
+            std::max(1, 
config::table_sink_partition_write_max_partition_nums_per_writer));
+    if (writer_count > std::numeric_limits<uint32_t>::max() / 
partitions_per_writer) {
+        return Status::InvalidArgument("External sink logical partition count 
overflows");
+    }
+    *result = writer_count * partitions_per_writer;
+    return Status::OK();
+}
+} // namespace
+
+ExternalTableSinkHashPartitioner::ExternalTableSinkHashPartitioner(
+        HashValType partition_count, bool use_new_shuffle_hash_method,
+        TExternalTableSinkHashPartitionInfo partition_info)
+        : PartitionerBase(partition_count),
+          _use_new_shuffle_hash_method(use_new_shuffle_hash_method),

Review Comment:
   _use_new_shuffle_hash_method似乎是飞线代码



-- 
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]

Reply via email to