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


##########
be/src/exec/partitioner/partitioner.h:
##########
@@ -212,6 +212,26 @@ class Crc32CHashPartitioner : public 
Crc32HashPartitioner<ShiftChannelIds> {
     }
 };
 
+// Bucket-shuffle repartitioner for tables bucketed with the identity hash. 
Each distribution
+// column's canonical bytes are interpreted as an unsigned integer with the 
first byte as the least
+// significant, then appended to the preceding columns; the combined value is 
kept modulo the
+// bucket count. Must stay bit-identical with FE HashDistributionPruner and BE 
tablet routing.
+class IdentityHashPartitioner : public Crc32HashPartitioner<ShuffleChannelIds> 
{
+public:
+    IdentityHashPartitioner(int partition_count)
+            : Crc32HashPartitioner<ShuffleChannelIds>(partition_count) {}
+
+    Status clone(RuntimeState* state, std::unique_ptr<PartitionerBase>& 
partitioner) override;
+
+private:
+    void _do_hash(const ColumnPtr& column, HashValType* __restrict result, int 
idx) const override;
+
+    void _initialize_hash_vals(size_t rows) const override {

Review Comment:
   Non-blocking simplification: could we remove this override and inherit the 
base implementation? 
`Crc32HashPartitioner<ShuffleChannelIds>::_initialize_hash_vals()` already 
performs the same resize and zero-fill. Removing this duplicate keeps the 
initialization behavior unchanged and leaves one implementation to maintain.



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