HappenLee commented on code in PR #25596:
URL: https://github.com/apache/doris/pull/25596#discussion_r1364818705


##########
be/src/pipeline/exec/exchange_sink_operator.cpp:
##########
@@ -211,6 +206,20 @@ Status ExchangeSinkLocalState::init(RuntimeState* state, 
LocalSinkStateInfo& inf
         }
         _exchange_sink_dependency->add_child(deps_for_channels);
     }
+    if (p._part_type == TPartitionType::HASH_PARTITIONED) {
+        _partition_count = channels.size();
+        _partitioner.reset(
+                new vectorized::HashPartitioner(channels.size(), 
&_split_block_hash_compute_timer));
+        RETURN_IF_ERROR(_partitioner->init(p._texprs));
+        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
+        RETURN_IF_ERROR(_partitioner->open(state));
+    } else if (p._part_type == 
TPartitionType::BUCKET_SHFFULE_HASH_PARTITIONED) {
+        _partition_count = channel_shared_ptrs.size();
+        _partitioner.reset(new 
vectorized::BucketHashPartitioner(channel_shared_ptrs.size()));
+        RETURN_IF_ERROR(_partitioner->init(p._texprs));

Review Comment:
   ```
    RETURN_IF_ERROR(_partitioner->init(p._texprs));
           RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
           RETURN_IF_ERROR(_partitioner->open(state));
   ```
   
   better only write once.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to