diff --git a/cpp/src/arrow/dataset/file_skyhook.cc b/cpp/src/arrow/dataset/file_skyhook.cc index 8106d5c6578fd..7925a89933b09 100644 --- a/cpp/src/arrow/dataset/file_skyhook.cc +++ b/cpp/src/arrow/dataset/file_skyhook.cc @@ -132,7 +132,8 @@ SkyhookFileFormat::SkyhookFileFormat(const std::string& fragment_format, SkyhookFileFormat::SkyhookFileFormat( const std::shared_ptr& connection) { - connection->Connect(); + Status s = connection->Connect(); + if (!s.ok()) throw std::runtime_error(s.message()); auto doa = std::make_shared(connection); doa_ = doa; } @@ -145,7 +146,7 @@ Result> SkyhookFileFormat::Inspect( } else if (fragment_format_ == "ipc") { format = std::make_shared(); } else { - return Status::Invalid("invalid file format"); + return Status::Invalid("Invalid file format"); } std::shared_ptr schema; ARROW_ASSIGN_OR_RAISE(schema, format->Inspect(source)); diff --git a/cpp/src/arrow/dataset/rados.cc b/cpp/src/arrow/dataset/rados.cc index 6c9c449f3879e..5d31fe13bb0f6 100644 --- a/cpp/src/arrow/dataset/rados.cc +++ b/cpp/src/arrow/dataset/rados.cc @@ -59,7 +59,9 @@ int RadosWrapper::init2(const char* const name, const char* const clustername, int RadosWrapper::ioctx_create(const char* name, IoCtxInterface* pioctx) { librados::IoCtx ioCtx; int ret = this->cluster->ioctx_create(name, ioCtx); - pioctx->setIoCtx(&ioCtx); + if (!ret) { + pioctx->setIoCtx(&ioCtx); + } return ret; }