Tim Armstrong has posted comments on this change.

Change subject: IMPALA-3905: HdfsScanner::GetNext() for Avro, RC, and Seq scans.
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/6527/5/be/src/exec/kudu-scan-node.cc
File be/src/exec/kudu-scan-node.cc:

Line 179:       if 
(materialized_row_batches_->AddBatchWithTimeout(move(row_batch), 1000000)) {
> You could add an output parameter to BlockingPutWithTimeout() (rather than 
My understand was that move() didn't actually modify the object, it just 
produced an rvalue ref to the object. Instead the destruction of the source 
object would happen when the move constructor or assign operator is invoked. 
This test program seems to confirm this understanding:

    #include <memory>
    #include <iostream>

    using std::cout;
    using std::move;
    using std::unique_ptr;

    void pass_by_rvalue_ref(unique_ptr<int>&& ref, bool do_assign) {
      if (do_assign) {
        unique_ptr<int> tmp = move(ref);
      }
    }
    void pass_by_value(unique_ptr<int>ref) { }


    int main() {
      unique_ptr<int> p(new int);
      cout << "Initial: " << p.get() << "\n";
      pass_by_rvalue_ref(move(p), false);
      cout << "After pass by rvalue ref no assign: " << p.get() << "\n";
      pass_by_value(move(p));
      cout << "After pass by value: " << p.get() << "\n";

      p.reset(new int);
      cout << "Initial: " << p.get() << "\n";
      pass_by_rvalue_ref(move(p), true);
      cout << "After pass by rvalue ref assign: " << p.get() << "\n";
      return 0;
    }

The output is:

    tarmstrong@tarmstrong-box:~$ g++ -std=c++14 uniq.cc -o uniq && ./uniq
    Initial: 0x19d2c20
    After pass by rvalue ref no assign: 0x19d2c20
    After pass by value: 0
    Initial: 0x19d2c20
    After pass by rvalue ref assign: 0


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie18f57b0d3fe0052a8ccd361b6a5fcdf979d0669
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Henry Robinson <[email protected]>
Gerrit-Reviewer: Marcel Kornacker <[email protected]>
Gerrit-Reviewer: Sailesh Mukil <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Reviewer: anujphadke <[email protected]>
Gerrit-HasComments: Yes

Reply via email to