Skip to content

Commit

Permalink
Remove all deprecated APIs. (#5146)
Browse files Browse the repository at this point in the history
[SC-50038](https://app.shortcut.com/tiledb-inc/story/50038/remove-deprecated-apis)

Consistent with [the announcement made in 2.23.0's release
notes](https://github.com/TileDB-Inc/TileDB/releases/tag/2.23.0), this
PR removes all deprecated C and C++ APIs. The infrastructure supporting
the `TILEDB_REMOVE_DEPRECATIONS` CMake option was kept, in case we want
to deprecate another API in the future.

---
TYPE: BREAKING_API
DESC: All deprecated C and C++ APIs were removed.
  • Loading branch information
teo-tsirpanis authored Jul 16, 2024
1 parent 0b9b277 commit 1154ce9
Show file tree
Hide file tree
Showing 28 changed files with 119 additions and 3,741 deletions.
24 changes: 12 additions & 12 deletions test/src/cpp-integration-query-condition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ TEST_CASE(
subarray_w.add_range("d", range[0], range[1]);
query_w.set_subarray(subarray_w);
query_w.set_layout(TILEDB_ROW_MAJOR);
query_w.set_buffer("a", vals);
query_w.set_data_buffer("a", vals);
REQUIRE(query_w.submit() == Query::Status::COMPLETE);

// Write values from 3-6 as 7 in the array.
Expand All @@ -1577,7 +1577,7 @@ TEST_CASE(
subarray_w2.add_range("d", range2[0], range2[1]);
query_w2.set_subarray(subarray_w2);
query_w2.set_layout(TILEDB_ROW_MAJOR);
query_w2.set_buffer("a", vals2);
query_w2.set_data_buffer("a", vals2);
REQUIRE(query_w2.submit() == Query::Status::COMPLETE);

array.close();
Expand All @@ -1596,7 +1596,7 @@ TEST_CASE(
subarray_r.add_range("d", range[0], range[1]);
query_r.set_subarray(subarray_r);
query_r.set_layout(TILEDB_ROW_MAJOR);
query_r.set_buffer("a", vals_read);
query_r.set_data_buffer("a", vals_read);
query_r.set_condition(qc);
REQUIRE(query_r.submit() == Query::Status::COMPLETE);

Expand Down Expand Up @@ -1645,17 +1645,17 @@ TEST_CASE(
// Write all values as 3 in the array.
std::vector<int> vals = {3, 3, 3, 3, 3, 3, 3, 3, 3, 3};
Query query_w(ctx, array, TILEDB_WRITE);
query_w.set_buffer("d", dim_vals);
query_w.set_buffer("a", vals);
query_w.set_buffer("a2", vals);
query_w.set_data_buffer("d", dim_vals);
query_w.set_data_buffer("a", vals);
query_w.set_data_buffer("a2", vals);
REQUIRE(query_w.submit() == Query::Status::COMPLETE);

// Write values from 1-10 as 7 in the array.
std::vector<int> vals2 = {7, 7, 7, 7, 7, 7, 7, 7, 7, 6};
Query query_w2(ctx, array, TILEDB_WRITE);
query_w2.set_buffer("d", dim_vals);
query_w2.set_buffer("a", vals2);
query_w2.set_buffer("a2", vals);
query_w2.set_data_buffer("d", dim_vals);
query_w2.set_data_buffer("a", vals2);
query_w2.set_data_buffer("a2", vals);
REQUIRE(query_w2.submit() == Query::Status::COMPLETE);

array.close();
Expand All @@ -1673,9 +1673,9 @@ TEST_CASE(
std::vector<int> dim_vals_read(10);
Query query_r(ctx, array_r, TILEDB_READ);
query_r.set_layout(TILEDB_GLOBAL_ORDER);
query_r.set_buffer("a", vals_read);
query_r.set_buffer("a2", vals_read2);
query_r.set_buffer("d", dim_vals_read);
query_r.set_data_buffer("a", vals_read);
query_r.set_data_buffer("a2", vals_read2);
query_r.set_data_buffer("d", dim_vals_read);
query_r.set_condition(qc);
REQUIRE(query_r.submit() == Query::Status::COMPLETE);

Expand Down
4 changes: 3 additions & 1 deletion test/src/unit-arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ void allocate_query_buffers(tiledb::Query* const query) {

bool has_ranges = false;
for (uint64_t dim_idx = 0; dim_idx < schema.domain().ndim(); dim_idx++) {
if (query->range_num(dim_idx) > 0) {
Subarray subarray(query->ctx(), query->array());
query->update_subarray_from_query(&subarray);
if (subarray.range_num(dim_idx) > 0) {
has_ranges = true;
break;
}
Expand Down
13 changes: 7 additions & 6 deletions test/src/unit-backwards_compat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void set_query_coords(
Subarray sub(ctx, *array);
sub.set_subarray<T>(static_cast<T*>(subarray), 2 * ndim);

query->set_coordinates<T>(static_cast<T*>(*coordinates), ndim);
query->set_data_buffer<T>("__coords", static_cast<T*>(*coordinates), ndim);
query->set_subarray(sub);

std::free(subarray);
Expand Down Expand Up @@ -136,8 +136,9 @@ void set_query_var_dimension_buffer(

memset(*offsets, 0, sizeof(uint64_t));
memset(*buffer, 0, buffer_size);
query->set_buffer<T>(
dimension.name(), *offsets, 1, static_cast<T*>(*buffer), buffer_size);
query->set_data_buffer<T>(
dimension.name(), static_cast<T*>(*buffer), buffer_size);
query->set_offsets_buffer(dimension.name(), *offsets, 1);
subarray->add_range(dim_idx, std::string("1"), std::string("1"));
}

Expand Down Expand Up @@ -208,7 +209,7 @@ TEST_CASE(
query_r.set_subarray(sub)
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", a_read)
.set_coordinates(coords_read);
.set_data_buffer("__coords", coords_read);
query_r.submit();

// Note: If you encounter a failure here, in particular with a_read[0] == 100
Expand Down Expand Up @@ -720,7 +721,7 @@ TEST_CASE(
Query query_w(ctx, old_array);
query_w.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", a_write)
.set_coordinates(coords_write);
.set_data_buffer("__coords", coords_write);
query_w.submit();
old_array.close();

Expand All @@ -736,7 +737,7 @@ TEST_CASE(
query_r.set_subarray(subarray_r)
.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", a_read)
.set_coordinates(coords_read);
.set_data_buffer("__coords", coords_read);
query_r.submit();
array.close();

Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-capi-serialized_queries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ TEST_CASE_METHOD(
Subarray cppapi_subarray(ctx, array);
cppapi_subarray.set_subarray(subarray);
query.set_subarray(cppapi_subarray);
query.set_coordinates(coords);
query.set_data_buffer("__coords", coords);
query.set_data_buffer("a1", a1);
query.set_data_buffer("a2", a2);
query.set_validity_buffer("a2", a2_nullable);
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-cppapi-checksum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void run_checksum_test(tiledb_filter_type_t filter_type) {
query.set_data_buffer("a1", a1_data)
.set_data_buffer("a2", a2buf.second)
.set_offsets_buffer("a2", a2buf.first)
.set_coordinates(coords)
.set_data_buffer("__coords", coords)
.set_layout(TILEDB_UNORDERED);
REQUIRE(query.submit() == Query::Status::COMPLETE);

Expand Down
18 changes: 15 additions & 3 deletions test/src/unit-cppapi-consolidation-with-timestamps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ void ConsolidationWithTimestampsFx::write_sparse(
std::vector<uint64_t> dim2,
uint64_t timestamp) {
// Open array.
Array array(ctx_, SPARSE_ARRAY_NAME, TILEDB_WRITE, timestamp);
Array array(
ctx_,
SPARSE_ARRAY_NAME,
TILEDB_WRITE,
tiledb::TemporalPolicy(tiledb::TimeTravel, timestamp));

// Create query.
Query query(ctx_, array, TILEDB_WRITE);
Expand All @@ -193,7 +197,11 @@ void ConsolidationWithTimestampsFx::write_sparse_v11(uint64_t timestamp) {
std::vector<uint64_t> buffer_coords_dim2{1, 2, 4, 3};

// Open array.
Array array(ctx_, SPARSE_ARRAY_NAME, TILEDB_WRITE, timestamp);
Array array(
ctx_,
SPARSE_ARRAY_NAME,
TILEDB_WRITE,
tiledb::TemporalPolicy(tiledb::TimeTravel, timestamp));

// Create query.
Query query(ctx_, array, TILEDB_WRITE);
Expand Down Expand Up @@ -290,7 +298,11 @@ void ConsolidationWithTimestampsFx::read_sparse(
uint64_t timestamp,
std::vector<uint64_t>* timestamps_ptr) {
// Open array.
Array array(ctx_, SPARSE_ARRAY_NAME, TILEDB_READ, timestamp);
Array array(
ctx_,
SPARSE_ARRAY_NAME,
TILEDB_READ,
tiledb::TemporalPolicy(tiledb::TimeTravel, timestamp));

// Create query.
Query query(ctx_, array, TILEDB_READ);
Expand Down
6 changes: 3 additions & 3 deletions test/src/unit-cppapi-datetimes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TEST_CASE("C++ API: Datetime attribute", "[cppapi][datetime]") {
Query query_w(ctx, array_w);
query_w.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w)
.set_coordinates(coords_w)
.set_data_buffer("__coords", coords_w)
.submit();
query_w.finalize();
array_w.close();
Expand All @@ -76,7 +76,7 @@ TEST_CASE("C++ API: Datetime attribute", "[cppapi][datetime]") {
Query query_r(ctx, array_r);
query_r.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_r)
.set_coordinates(coords_r);
.set_data_buffer("__coords", coords_r);
REQUIRE(query_r.submit() == Query::Status::COMPLETE);

auto result_num = query_r.result_buffer_elements()["a"].second;
Expand Down Expand Up @@ -118,7 +118,7 @@ TEST_CASE("C++ API: Datetime dimension", "[cppapi][datetime]") {
Query query_w(ctx, array_w);
query_w.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w)
.set_coordinates(coords_w)
.set_data_buffer("__coords", coords_w)
.submit();
query_w.finalize();
array_w.close();
Expand Down
6 changes: 5 additions & 1 deletion test/src/unit-cppapi-deletes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ void DeletesFx::write_sparse_v11(uint64_t timestamp) {
std::vector<uint64_t> buffer_coords_dim2{1, 2, 4, 3};

// Open array.
Array array(ctx_, array_name_.c_str(), TILEDB_WRITE, timestamp);
Array array(
ctx_,
array_name_.c_str(),
TILEDB_WRITE,
tiledb::TemporalPolicy(tiledb::TimeTravel, timestamp));

// Create query.
Query query(ctx_, array, TILEDB_WRITE);
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-cppapi-filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ TEST_CASE(
query.set_data_buffer("a1", a1_data)
.set_data_buffer("a2", a2buf.second)
.set_offsets_buffer("a2", a2buf.first)
.set_coordinates(coords)
.set_data_buffer("__coords", coords)
.set_layout(TILEDB_UNORDERED);
REQUIRE(query.submit() == Query::Status::COMPLETE);
array.close();
Expand Down
6 changes: 5 additions & 1 deletion test/src/unit-cppapi-metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,11 @@ TEST_CASE_METHOD(

// Create and open array in write mode
tiledb::Context ctx;
tiledb::Array array(ctx, std::string(array_name_), TILEDB_WRITE, 1);
tiledb::Array array(
ctx,
std::string(array_name_),
TILEDB_WRITE,
tiledb::TemporalPolicy(tiledb::TimeTravel, 1));

// Write items
int32_t v = 5;
Expand Down
12 changes: 10 additions & 2 deletions test/src/unit-cppapi-partial-attribute-write.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ void CppPartialAttrWriteFx::write_sparse_dims(
std::unique_ptr<Array>& array,
std::unique_ptr<Query>& query) {
// Open array.
array = std::make_unique<Array>(ctx_, array_name_, TILEDB_WRITE, timestamp);
array = std::make_unique<Array>(
ctx_,
array_name_,
TILEDB_WRITE,
tiledb::TemporalPolicy(tiledb::TimeTravel, timestamp));

// Create query.
query = std::make_unique<Query>(ctx_, *array, TILEDB_WRITE);
Expand All @@ -148,7 +152,11 @@ void CppPartialAttrWriteFx::write_sparse_dims_and_a1(
std::unique_ptr<Array>& array,
std::unique_ptr<Query>& query) {
// Open array.
array = std::make_unique<Array>(ctx_, array_name_, TILEDB_WRITE, timestamp);
array = std::make_unique<Array>(
ctx_,
array_name_,
TILEDB_WRITE,
tiledb::TemporalPolicy(tiledb::TimeTravel, timestamp));

// Create query.
query = std::make_unique<Query>(ctx_, *array, TILEDB_WRITE);
Expand Down
6 changes: 3 additions & 3 deletions test/src/unit-cppapi-query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ TEST_CASE(
std::vector<int> coords_w = {0, 0, 1, 1, 2, 2, 3, 3};
Array array_w(ctx, array_name, TILEDB_WRITE);
Query query_w(ctx, array_w);
query_w.set_coordinates(coords_w)
query_w.set_data_buffer("__coords", coords_w)
.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w);
query_w.submit();
Expand All @@ -221,7 +221,7 @@ TEST_CASE(
// Open and write to the same array without closing it.
Array array2(ctx, array_name, TILEDB_WRITE);
Query query2(ctx, array2);
query2.set_coordinates(coords_w)
query2.set_data_buffer("__coords", coords_w)
.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w);
query2.submit();
Expand Down Expand Up @@ -324,7 +324,7 @@ TEST_CASE(
std::vector<uint8_t> coords_w = {0, 0, 1, 1, 2, 2, 3, 3};
Array array_w(ctx, array_name, TILEDB_WRITE);
Query query_w(ctx, array_w);
query_w.set_coordinates(coords_w)
query_w.set_data_buffer("__coords", coords_w)
.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w);
query_w.submit();
Expand Down
6 changes: 3 additions & 3 deletions test/src/unit-cppapi-time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TEST_CASE("C++ API: Time attribute", "[cppapi][Time]") {
Query query_w(ctx, array_w);
query_w.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w)
.set_coordinates(coords_w)
.set_data_buffer("__coords", coords_w)
.submit();
query_w.finalize();
array_w.close();
Expand All @@ -86,7 +86,7 @@ TEST_CASE("C++ API: Time attribute", "[cppapi][Time]") {
Query query_r(ctx, array_r);
query_r.set_layout(TILEDB_ROW_MAJOR)
.set_data_buffer("a", data_r)
.set_coordinates(coords_r);
.set_data_buffer("__coords", coords_r);
REQUIRE(query_r.submit() == Query::Status::COMPLETE);

auto result_num = query_r.result_buffer_elements()["a"].second;
Expand Down Expand Up @@ -138,7 +138,7 @@ TEST_CASE("C++ API: Time dimension", "[cppapi][time]") {
Query query_w(ctx, array_w);
query_w.set_layout(TILEDB_UNORDERED)
.set_data_buffer("a", data_w)
.set_coordinates(coords_w)
.set_data_buffer("__coords", coords_w)
.submit();
query_w.finalize();
array_w.close();
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-tile-metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ struct CPPVarTileMetadataFx {
query.set_data_buffer("d", d);
}
query.set_offsets_buffer("a", a_offsets);
query.set_buffer("a", a_var);
query.set_data_buffer("a", a_var);

if (nullable) {
query.set_validity_buffer("a", a_val);
Expand Down
3 changes: 0 additions & 3 deletions tiledb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ if (TILEDB_CPP_API)
list(APPEND TILEDB_PUBLIC_HEADERS
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/tiledb
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/tiledb_experimental
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array_deprecated.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array_experimental.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array_schema.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array_schema_deprecated.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array_schema_evolution.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/array_schema_experimental.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/as_built_experimental.h
Expand Down Expand Up @@ -113,7 +111,6 @@ if (TILEDB_CPP_API)
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/query_channel.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/query_condition_experimental.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/query_condition.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/query_deprecated.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/query_experimental.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/schema_base.h
${TILEDB_CORE_INCLUDE_DIR}/tiledb/sm/cpp_api/stats.h
Expand Down
Loading

0 comments on commit 1154ce9

Please sign in to comment.