westonpace commented on code in PR #14257:
URL: https://github.com/apache/arrow/pull/14257#discussion_r989224825


##########
cpp/src/arrow/dataset/dataset_writer_test.cc:
##########
@@ -234,6 +234,18 @@ TEST_F(DatasetWriterTestFixture, BasicFileDirectoryPrefix) 
{
   AssertFilesCreated({"testdir/a/1_chunk-0.arrow"});
 }
 
+TEST_F(DatasetWriterTestFixture, DirectoryCreateFails) {
+  // This should fail to be created
+  write_options_.base_dir = "///doesnotexist";
+  EXPECT_OK_AND_ASSIGN(auto dataset_writer,
+                       DatasetWriter::Make(write_options_, scheduler_.get()));
+  Future<> queue_fut = dataset_writer->WriteRecordBatch(MakeBatch(100), "a", 
"1_");
+  AssertFinished(queue_fut);
+  ASSERT_OK(dataset_writer->Finish());
+  scheduler_->End();
+  ASSERT_FINISHES_AND_RAISES(Invalid, scheduler_->OnFinished());

Review Comment:
   A writing failure is usually asynchronous (or at least we pretend it is).  
So there is no calling thread to notify.  Instead the scheduler enters an 
aborted state (new tasks will not start).  However, it would probably be a good 
idea for the write node to check and see if the scheduler is in an aborted 
state (it will notice because AddTask will start returning false) and go ahead 
and abort the plan.



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