Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/20850 )
Change subject: IMPALA-12533: Support row materialization outside of fetch lock ...................................................................... Patch Set 10: (7 comments) Took an initial pass, this is mostly style nits. I still need to get into the heart of the query-result-set.* files. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/codegen/llvm-codegen-test.cc File be/src/codegen/llvm-codegen-test.cc: http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/codegen/llvm-codegen-test.cc@459 PS10, Line 459: const auto close_codegen = : MakeScopeExitTrigger([&codegen]() { codegen.reset(); }); Nit: The shared_ptr should be freed automatically at the end of this function, so this scope exit trigger shouldn't be needed anymore. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/codegen/llvm-codegen-test.cc@525 PS10, Line 525: codegen.reset(); Nit: The shared_ptr will get reset at the end of the function, so the "codegen.reset()" calls at the end of a function are not necessary. The reset() calls in other locations where we care about the order of frees still matter. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/codegen/llvm-codegen-test.cc@553 PS10, Line 553: const auto close_codegen = MakeScopeExitTrigger([&codegen]() { codegen.reset(); }); Same thing as above. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/codegen/llvm-codegen.h File be/src/codegen/llvm-codegen.h: http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/codegen/llvm-codegen.h@666 PS10, Line 666: static Status CreateFromFile(FragmentState* state, ObjectPool* pool, : MemTracker* parent_mem_tracker, const std::string& file, : const std::string& id, boost::scoped_ptr<LlvmCodeGen>* codegen); Nit: I think this might be the last use of boost::scoped_ptr in this file. Changing this to a shared_ptr to match CreateFromMemory or a unique_ptr to signal exclusive ownership could drop that dependency. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/exprs/expr-codegen-test.cc File be/src/exprs/expr-codegen-test.cc: http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/exprs/expr-codegen-test.cc@360 PS10, Line 360: codegen.reset(); Nit: Same comment as elsewhere, this reset() call is not strictly necessary. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/runtime/row-batch.h File be/src/runtime/row-batch.h: http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/runtime/row-batch.h@327 PS10, Line 327: /// Deep copy num_rows from this row batch into dst stating at start_idx, using memory : /// allocated from dst's tuple_data_pool_. : /// TODO: the current implementation of CopyRows can produce an oversized : /// row batch if there are duplicate tuples in this row batch. : void CopyRows(RowBatch* dst, int start_idx, int num_rows); Two thoughts: 1. We have other CopyRows() methods that aren't doing deep copies, so I would prefer to call this method something else that makes it clear it is a deep copy. Maybe something like DeepCopyRows()? 2. For the comment, it would be nice to make a distinction between this function vs DeepCopyTo(). If I'm understanding this correctly, the difference is that this allows copying a subset of rows and the dst doesn't need to be empty at the start. http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/runtime/row-batch.cc File be/src/runtime/row-batch.cc: http://gerrit.cloudera.org:8080/#/c/20850/10/be/src/runtime/row-batch.cc@484 PS10, Line 484: void RowBatch::CopyRows(RowBatch* dst, int start_idx, int num_rows) { One other DCHECK we can do is to assert that the source and destination are different RowBatch objects. I think that was implicit in DeepCopyTo() by checking dst->num_rows_ == 0. -- To view, visit http://gerrit.cloudera.org:8080/20850 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If9512aa6022dbcf81e7eb5f559853b89fe80bd23 Gerrit-Change-Number: 20850 Gerrit-PatchSet: 10 Gerrit-Owner: Kurt Deschler <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Kurt Deschler <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Comment-Date: Tue, 30 Jan 2024 18:24:27 +0000 Gerrit-HasComments: Yes
