Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
SKYHOOK-293: [C++] Throw error on passing wrong config to SkyhookFile…
Browse files Browse the repository at this point in the history
…Format
  • Loading branch information
JayjeetAtGithub committed Mar 17, 2022
1 parent 6895138 commit 9e3bd50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cpp/src/arrow/dataset/file_skyhook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ SkyhookFileFormat::SkyhookFileFormat(const std::string& fragment_format,

SkyhookFileFormat::SkyhookFileFormat(
const std::shared_ptr<connection::RadosConnection>& connection) {
connection->Connect();
Status s = connection->Connect();
if (!s.ok()) throw std::runtime_error(s.message());
auto doa = std::make_shared<arrow::dataset::SkyhookDirectObjectAccess>(connection);
doa_ = doa;
}
Expand All @@ -145,7 +146,7 @@ Result<std::shared_ptr<Schema>> SkyhookFileFormat::Inspect(
} else if (fragment_format_ == "ipc") {
format = std::make_shared<IpcFileFormat>();
} else {
return Status::Invalid("invalid file format");
return Status::Invalid("Invalid file format");
}
std::shared_ptr<Schema> schema;
ARROW_ASSIGN_OR_RAISE(schema, format->Inspect(source));
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/arrow/dataset/rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9e3bd50

Please sign in to comment.