Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing query_type in array_open capnp #3616

Merged
merged 4 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions tiledb/sm/array/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,6 @@ tuple<Status, optional<shared_ptr<ArraySchema>>> Array::get_array_schema()
}

QueryType Array::get_query_type() const {
// Error if the array is not open
if (!is_open_) {
throw StatusException(
Status_ArrayError("Cannot get query_type; Array is not open"));
}

return query_type_;
}

Expand Down
5 changes: 5 additions & 0 deletions tiledb/sm/array/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ class Array {
/** Checks the config to see if refactored array open should be used. */
bool use_refactored_array_open() const;

/** Set the query type to open the array for. */
inline void set_query_type(QueryType query_type) {
query_type_ = query_type;
}

private:
/* ********************************* */
/* PRIVATE ATTRIBUTES */
Expand Down
9 changes: 9 additions & 0 deletions tiledb/sm/serialization/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ Status array_open_to_capnp(
auto config = array.config();
RETURN_NOT_OK(config_to_capnp(config, &config_builder));

array_open_builder->setQueryType(query_type_str(array.get_query_type()));

return Status::Ok();
}

Expand All @@ -260,6 +262,13 @@ Status array_open_from_capnp(
RETURN_NOT_OK(array->set_config(*decoded_config));
}

if (array_open_reader.hasQueryType()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

auto query_type_str = array_open_reader.getQueryType();
QueryType query_type;
RETURN_NOT_OK(query_type_enum(query_type_str, &query_type));
array->set_query_type(query_type);
}

return Status::Ok();
}

Expand Down
38 changes: 27 additions & 11 deletions tiledb/sm/serialization/posix/tiledb-rest.capnp.c++

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 49 additions & 1 deletion tiledb/sm/serialization/posix/tiledb-rest.capnp.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tiledb/sm/serialization/tiledb-rest.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct Array {
struct ArrayOpen {
config @0 :Config;
# Config
queryType @1 :Text;
# Query type to open the array for
}

struct ArraySchema {
Expand Down