pitrou commented on code in PR #14480:
URL: https://github.com/apache/arrow/pull/14480#discussion_r1004119438


##########
cpp/src/arrow/compute/exec/exec_plan.cc:
##########
@@ -602,7 +602,9 @@ Future<std::vector<ExecBatch>> 
DeclarationToExecBatchesAsync(Declaration declara
       .Then([collected_fut, exec_plan]() -> Result<std::vector<ExecBatch>> {
         ARROW_ASSIGN_OR_RAISE(auto collected, collected_fut.result());
         return ::arrow::internal::MapVector(
-            [](std::optional<ExecBatch> batch) { return std::move(*batch); },
+            [](std::optional<ExecBatch> batch) {
+              return ARROW_PREDICT_TRUE(batch) ? std::move(*batch) : 
ExecBatch();

Review Comment:
   This is fine with me, but could also use 
https://en.cppreference.com/w/cpp/utility/optional/value_or for concision.



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

Reply via email to