You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/20 06:26:39 UTC

[GitHub] [arrow] Crystrix commented on a change in pull request #12032: ARROW-15126: [C++] Support Null type as group keys

Crystrix commented on a change in pull request #12032:
URL: https://github.com/apache/arrow/pull/12032#discussion_r788387466



##########
File path: cpp/src/arrow/compute/kernels/hash_aggregate.cc
##########
@@ -147,10 +152,13 @@ struct GrouperImpl : Grouper {
       if (it_success.second) {
         // new key; update offsets and key_bytes
         ++num_groups_;
-        auto next_key_offset = static_cast<int32_t>(key_bytes_.size());
-        key_bytes_.resize(next_key_offset + key_length);
-        offsets_.push_back(next_key_offset + key_length);
-        memcpy(key_bytes_.data() + next_key_offset, key.c_str(), key_length);
+        if (key_length != 0) {

Review comment:
       Fixed

##########
File path: cpp/src/arrow/compute/kernels/row_encoder.h
##########
@@ -231,6 +231,26 @@ struct VarLengthKeyEncoder : KeyEncoder {
   std::shared_ptr<DataType> type_;
 };
 
+struct NullKeyEncoder : KeyEncoder {
+  void AddLength(const Datum&, int64_t batch_length, int32_t* lengths) override {
+    return;
+  }

Review comment:
       Fixed




-- 
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: github-unsubscribe@arrow.apache.org

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