impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Robinson (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-3742: partitions DMLs for Kudu tables
Date Thu, 16 Mar 2017 17:07:33 GMT
Henry Robinson has posted comments on this change.

Change subject: IMPALA-3742: partitions DMLs for Kudu tables
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6037/8/be/src/runtime/data-stream-sender.cc
File be/src/runtime/data-stream-sender.cc:

PS8, Line 445:  switch (partitioner_->type()) {
             :       case TPartitionType::HASH_PARTITIONED:
             :         RETURN_IF_ERROR(
             :             reinterpret_cast<HashStreamPartitioner*>(partitioner_.get())
             :                 ->Partition(batch,
             :                     [this, num_channels](TupleRow* row, uint32_t partition)
-> Status {
             :                       return this->channels_[partition % num_channels]->AddRow(row);
             :                     }));
             :         break;
             :       case TPartitionType::KUDU:
             :         RETURN_IF_ERROR(
             :             reinterpret_cast<KuduStreamPartitioner*>(partitioner_.get())
             :                 ->Partition(batch,
             :                     [this, num_channels](TupleRow* row, uint32_t partition)
-> Status {
             :                       return this->channels_[partition % num_channels]->AddRow(row);
             :                     }));
             :         break;
Looking at how this came out in the code, my feeling is that it might be cleaner to produce
the vector of partitions:

  virtual void Partition(RowBatch*  batch, vector<int>* partitions);
  for (int i = 0; i < partitions->size(); ++i) {
    channels_[partitions[i] % num_channels]->AddRow(row);
  }

What do you think? One v-call per batch doesn't seem prohibitive.


-- 
To view, visit http://gerrit.cloudera.org:8080/6037
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic10b3295159354888efcde3df76b0edb24161515
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Marcel Kornacker <marcel@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj@cloudera.com>
Gerrit-Reviewer: Thomas Tauber-Marshall <tmarshall@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message