rtpsw commented on code in PR #13117:
URL: https://github.com/apache/arrow/pull/13117#discussion_r870764027
##########
cpp/src/arrow/dataset/file_base.cc:
##########
@@ -465,14 +465,7 @@ class TeeNode : public compute::MapNode {
// Need to wait for the task group to complete regardless of dw_status
task_group_.End().AddCallback(
[this, dw_status, finish_st](const Status& tg_status) {
- // Prefer dw_status then finish_st and then tg_status
- if (!dw_status.ok()) {
- finished_.MarkFinished(dw_status);
- }
- if (!finish_st.ok()) {
- finished_.MarkFinished(finish_st);
- }
- finished_.MarkFinished(tg_status);
+ finished_.MarkFinished(dw_status & finish_st & tg_status);
Review Comment:
Nothing to change, just a side comment: I think it is non-standard that
`Status::operator&` is short-circuiting, as this is normally the semantics of
`operator&&`.
##########
cpp/src/arrow/dataset/file_test.cc:
##########
@@ -349,18 +349,17 @@ TEST_F(TestFileSystemDataset, WriteProjected) {
}
class FileSystemWriteTest : public testing::TestWithParam<std::tuple<bool,
bool>> {
+ using PlanFactory = std::function<cp::Declaration(
+ const FileSystemDatasetWriteOptions&,
+ std::function<Future<util::optional<cp::ExecBatch>>()>*)>;
+
Review Comment:
I believe the concatenation code in this particular test could be even
simpler if `PlanFactory` had a return-type of `std::vector<Declaration>`,
because `Sequence` would do the checking-and-wiring work when passed the
concatenated vector. OTOH, the `Root` and `Concat` functions you added to
`Declaration` seem generally useful, so this test code is good for covering it.
I'll let you choose the alternative you prefer.
--
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]