Skip to content

Commit 7f7fa1d

Browse files
committed
Fix CI.
1 parent b00936b commit 7f7fa1d

File tree

8 files changed

+29
-19
lines changed

8 files changed

+29
-19
lines changed

test/src/cpp-integration-rest-schema-evolution.cc

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "tiledb/sm/cpp_api/tiledb_experimental"
3838
#include "tiledb/sm/rest/rest_client.h"
3939

40+
#include <climits>
4041
#include <fstream>
4142

4243
using namespace tiledb;

test/src/unit-capi-config.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void check_save_to_file() {
230230
ss << "rest.curl.buffer_size 524288\n";
231231
ss << "rest.curl.verbose false\n";
232232
ss << "rest.http_compressor any\n";
233-
ss << "rest.load_enumerations_on_array_open true\n";
233+
ss << "rest.load_enumerations_on_array_open false\n";
234234
ss << "rest.load_metadata_on_array_open true\n";
235235
ss << "rest.load_non_empty_domain_on_array_open true\n";
236236
ss << "rest.retry_count 25\n";

test/src/unit-request-handlers.cc

+19-14
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ struct HandleConsolidationPlanRequestFx : RequestHandlerFx {
126126
TEST_CASE_METHOD(
127127
HandleLoadArraySchemaRequestFx,
128128
"tiledb_handle_load_array_schema_request - no enumerations",
129-
"[request_handler][load_array_schema]") {
129+
"[request_handler][load_array_schema][default]") {
130130
auto stype = GENERATE(SerializationType::JSON, SerializationType::CAPNP);
131131

132132
create_array();
133-
REQUIRE(cfg_.set("rest.load_enumerations_on_array_open", "false").ok());
134133
auto schema_response =
135134
call_handler(serialization::LoadArraySchemaRequest(cfg_), stype);
136135
auto schema = std::get<0>(schema_response);
@@ -148,10 +147,11 @@ TEST_CASE_METHOD(
148147
TEST_CASE_METHOD(
149148
HandleLoadArraySchemaRequestFx,
150149
"tiledb_handle_load_array_schema_request - load enumerations",
151-
"[request_handler][load_array_schema][with-enumerations][default]") {
150+
"[request_handler][load_array_schema][with-enumerations]") {
152151
auto stype = GENERATE(SerializationType::JSON, SerializationType::CAPNP);
153152

154153
create_array();
154+
REQUIRE(cfg_.set("rest.load_enumerations_on_array_open", "true").ok());
155155
auto schema_response =
156156
call_handler(serialization::LoadArraySchemaRequest(cfg_), stype);
157157
auto schema = std::get<0>(schema_response);
@@ -173,6 +173,7 @@ TEST_CASE_METHOD(
173173
"tiledb_handle_load_array_schema_request - multiple schemas",
174174
"[request_handler][load_array_schema][schema-evolution]") {
175175
auto stype = GENERATE(SerializationType::JSON, SerializationType::CAPNP);
176+
std::string load_enums = GENERATE("true", "false");
176177

177178
create_array();
178179

@@ -184,15 +185,20 @@ TEST_CASE_METHOD(
184185
auto schema_response =
185186
call_handler(serialization::LoadArraySchemaRequest(cfg_), stype);
186187
auto schema = std::get<0>(schema_response);
187-
REQUIRE(schema->has_enumeration("enmr"));
188-
REQUIRE(schema->get_loaded_enumeration_names().size() == 1);
189-
REQUIRE(schema->get_loaded_enumeration_names()[0] == "enmr");
190-
REQUIRE(schema->get_enumeration("enmr") != nullptr);
188+
if (load_enums == "true") {
189+
REQUIRE(schema->has_enumeration("enmr"));
190+
REQUIRE(schema->get_loaded_enumeration_names().size() == 1);
191+
REQUIRE(schema->get_loaded_enumeration_names()[0] == "enmr");
192+
REQUIRE(schema->get_enumeration("enmr") != nullptr);
193+
}
191194
// The latest schema should be equal to the last applied evolution.
192195
tiledb::test::schema_equiv(*schema, *all_schemas.back());
193196

194-
// Validate all array schemas returned from the request.
195-
for (int i = 0; const auto& s : std::get<1>(schema_response)) {
197+
// Validate schemas returned from the request in the order they were created.
198+
auto r_all_schemas = std::get<1>(schema_response);
199+
std::map<std::string, shared_ptr<ArraySchema>> resp(
200+
r_all_schemas.begin(), r_all_schemas.end());
201+
for (int i = 0; const auto& s : resp) {
196202
tiledb::test::schema_equiv(*s.second, *all_schemas[i++]);
197203
}
198204
}
@@ -468,18 +474,17 @@ shared_ptr<ArraySchema> HandleLoadArraySchemaRequestFx::schema_add_attribute(
468474
tiledb::ArraySchemaEvolution ase(ctx);
469475
auto attr = tiledb::Attribute::create<int32_t>(ctx, attr_name);
470476
ase.add_attribute(attr);
471-
auto evolved = ase.ptr()->array_schema_evolution_->evolve_schema(schema_);
477+
// Evolve and update the original schema member variable.
478+
schema_ = ase.ptr()->array_schema_evolution_->evolve_schema(schema_);
472479
// Apply the schema evolution.
473480
Array::evolve_array_schema(
474481
this->ctx_.resources(),
475482
this->uri_,
476483
ase.ptr()->array_schema_evolution_,
477484
this->enc_key_);
478485

479-
// Update the original schema.
480-
schema_ = evolved;
481-
// Return the schema for validation.
482-
return evolved;
486+
// Return the new evolved schema for validation.
487+
return schema_;
483488
}
484489

485490
shared_ptr<ArraySchema> HandleLoadArraySchemaRequestFx::create_schema() {

tiledb/api/c_api/config/config_api_external.h

+4
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,10 @@ TILEDB_EXPORT void tiledb_config_free(tiledb_config_t** config) TILEDB_NOEXCEPT;
740740
* If true, array non empty domain will be loaded and sent to server together
741741
* with the open array <br>
742742
* **Default**: true
743+
* - `rest.load_enumerations_on_array_open` <br>
744+
* If true, enumerations will be loaded and sent to server together with
745+
* the open array.
746+
* **Default**: false
743747
* - `rest.use_refactored_array_open` <br>
744748
* If true, the new, experimental REST routes and APIs for opening an array
745749
* will be used <br>

tiledb/sm/array_schema/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ conclude(object_library)
9797
#
9898
commence(object_library array_schema_operations)
9999
this_target_sources(array_schema_operations.cc)
100-
this_target_object_libraries(array_schema generic_tile_io tiledb_crypto)
100+
this_target_object_libraries(array array_schema generic_tile_io tiledb_crypto)
101101
conclude(object_library)
102102

103103
add_test_subdirectory()

tiledb/sm/config/config.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const std::string Config::REST_RETRY_DELAY_FACTOR = "1.25";
9191
const std::string Config::REST_CURL_BUFFER_SIZE = "524288";
9292
const std::string Config::REST_CAPNP_TRAVERSAL_LIMIT = "2147483648";
9393
const std::string Config::REST_CURL_VERBOSE = "false";
94-
const std::string Config::REST_LOAD_ENUMERATIONS_ON_ARRAY_OPEN = "true";
94+
const std::string Config::REST_LOAD_ENUMERATIONS_ON_ARRAY_OPEN = "false";
9595
const std::string Config::REST_LOAD_METADATA_ON_ARRAY_OPEN = "true";
9696
const std::string Config::REST_LOAD_NON_EMPTY_DOMAIN_ON_ARRAY_OPEN = "true";
9797
const std::string Config::REST_USE_REFACTORED_ARRAY_OPEN = "false";

tiledb/sm/cpp_api/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ class Config {
910910
* - `rest.load_enumerations_on_array_open` <br>
911911
* If true, enumerations will be loaded and sent to server together with
912912
* the open array.
913-
* **Default**: true
913+
* **Default**: false
914914
* - `rest.load_metadata_on_array_open` <br>
915915
* If true, array metadata will be loaded and sent to server together with
916916
* the open array <br>

tiledb/sm/serialization/array_schema.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ LoadArraySchemaRequest deserialize_load_array_schema_request(
21542154
}
21552155

21562156
void serialize_load_array_schema_response(
2157-
const ArraySchema&, SerializationType, Buffer&) {
2157+
const Array&, SerializationType, Buffer&) {
21582158
throw ArraySchemaSerializationDisabledException();
21592159
}
21602160

0 commit comments

Comments
 (0)