Skip to content

Commit

Permalink
Merge branch 'dev' into s3-no-md5
Browse files Browse the repository at this point in the history
  • Loading branch information
KiterLuc authored Aug 14, 2024
2 parents 125cb35 + 5d6b47e commit 9479a81
Show file tree
Hide file tree
Showing 40 changed files with 528 additions and 243 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- ubuntu-20.04
# Note: v2_1_0 arrays were never created so its currently skipped
# Note: This matrix is used to set the value of TILEDB_COMPATIBILITY_VERSION
tiledb_version: ["v1_4_0", "v1_5_0", "v1_6_0", "v1_7_0", "v2_0_0", "v2_2_0", "v2_2_3", "v2_3_0", "v2_4_0", "v2_5_0", "v2_6_0", "v2_7_0", "v2_8_3", "v2_9_1", "v2_10_0", "v2_11_0", "v2_12_3", "v2_13_2", "v2_14_0", "v2_15_0", "v2_16_3", "v2_17_5", "v2_18_3", "v2_19_1", "v2_20_1", "v2_21_1", "v2_22_0", "v2_23_0", "v2_24_0"]
tiledb_version: ["v1_4_0", "v1_5_0", "v1_6_0", "v1_7_0", "v2_0_0", "v2_2_0", "v2_2_3", "v2_3_0", "v2_4_0", "v2_5_0", "v2_6_0", "v2_7_0", "v2_8_3", "v2_9_1", "v2_10_0", "v2_11_0", "v2_12_3", "v2_13_2", "v2_14_0", "v2_15_0", "v2_16_3", "v2_17_5", "v2_18_3", "v2_19_1", "v2_20_1", "v2_21_1", "v2_22_0", "v2_23_0", "v2_24_0", "v2_25_0"]
timeout-minutes: 30
name: ${{ matrix.tiledb_version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ jobs:
uses: TileDB-Inc/github-actions/open-issue@main
with:
name: Release failed
label: bug
label: release
assignee: KiterLuc,teo-tsirpanis,davisp
27 changes: 22 additions & 5 deletions examples/c_api/current_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void create_array() {
tiledb_ndrectangle_set_range_for_name(ctx, ndrect, "d1", &range);

// Assign the rectangle to the current domain
tiledb_current_domain_set_ndrectangle(current_domain, ndrect);
tiledb_current_domain_set_ndrectangle(ctx, current_domain, ndrect);

// Create a single attribute "a" so each cell can store an integer
tiledb_attribute_t* a;
Expand Down Expand Up @@ -119,21 +119,21 @@ void print_current_domain() {

// Check if current domain is empty
uint32_t is_empty;
tiledb_current_domain_get_is_empty(current_domain, &is_empty);
tiledb_current_domain_get_is_empty(ctx, current_domain, &is_empty);

if (is_empty) {
printf("Current domain: empty\n");
} else {
// Get current domain type
tiledb_current_domain_type_t current_domain_type;
tiledb_current_domain_get_type(current_domain, &current_domain_type);
tiledb_current_domain_get_type(ctx, current_domain, &current_domain_type);

if (current_domain_type == TILEDB_NDRECTANGLE) {
printf("Current domain type: NDRECTANGLE\n");

// Get the ND rectangle
tiledb_ndrectangle_t* ndrect;
tiledb_current_domain_get_ndrectangle(current_domain, &ndrect);
tiledb_current_domain_get_ndrectangle(ctx, current_domain, &ndrect);

tiledb_range_t range;
tiledb_ndrectangle_get_range_from_name(ctx, ndrect, "d1", &range);
Expand All @@ -143,6 +143,23 @@ void print_current_domain() {
*(int*)range.min,
*(int*)range.max);

// Get datatype of range
tiledb_datatype_t dtype;
tiledb_ndrectangle_get_dtype(ctx, ndrect, 0, &dtype);
const char* dtype_str;
tiledb_datatype_to_str(dtype, &dtype_str);
printf("Range 0 dtype: %s\n", dtype_str);

// Get datatype of range by name
tiledb_ndrectangle_get_dtype_from_name(ctx, ndrect, "d1", &dtype);
tiledb_datatype_to_str(dtype, &dtype_str);
printf("Range 0 dtype by name: %s\n", dtype_str);

// Get dim num
uint32_t ndim;
tiledb_ndrectangle_get_dim_num(ctx, ndrect, &ndim);
printf("Range 0 dtype by name: %d\n", ndim);

// Clean up
tiledb_ndrectangle_free(&ndrect);
} else {
Expand Down Expand Up @@ -191,7 +208,7 @@ void expand_current_domain() {
tiledb_ndrectangle_set_range_for_name(ctx, ndrect, "d1", &range);

// Set the rectangle to the current domain
tiledb_current_domain_set_ndrectangle(new_current_domain, ndrect);
tiledb_current_domain_set_ndrectangle(ctx, new_current_domain, ndrect);

// Expand the current domain
tiledb_array_schema_evolution_expand_current_domain(
Expand Down
11 changes: 11 additions & 0 deletions examples/cpp_api/current_domain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ void print_current_domain(Context& ctx) {
// Print the range
std::cout << "Current domain range: [" << range[0] << ", " << range[1] << "]"
<< std::endl;

// Print datatype of range 0
std::cout << "Current domain range 0 datatype: "
<< tiledb::impl::type_to_str(ndrect.range_dtype(0)) << std::endl;

// Print datatype of range d1
std::cout << "Current domain range 0 datatype: "
<< tiledb::impl::type_to_str(ndrect.range_dtype("d1")) << std::endl;

// Print dim num
std::cout << "Current domain dim num: " << ndrect.dim_num() << std::endl;
}

void expand_current_domain(Context& ctx) {
Expand Down
6 changes: 6 additions & 0 deletions ports/triplets/arm64-osx-asan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ set(VCPKG_OSX_ARCHITECTURES arm64)

set(VCPKG_C_FLAGS "-fsanitize=address")
set(VCPKG_CXX_FLAGS "-fsanitize=address")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/arm64-osx-release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ set(VCPKG_OSX_ARCHITECTURES arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

set(VCPKG_BUILD_TYPE release)

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/arm64-osx-relwithdebinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

set(VCPKG_CXX_FLAGS "-g")
set(VCPKG_C_FLAGS "-g")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/arm64-osx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES arm64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-linux-asan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ set(VCPKG_CMAKE_SYSTEM_NAME Linux)

set(VCPKG_C_FLAGS "-fsanitize=address")
set(VCPKG_CXX_FLAGS "-fsanitize=address")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-linux-release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)

set(VCPKG_BUILD_TYPE release)

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-linux-relwithdebinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ set(VCPKG_CMAKE_SYSTEM_NAME Linux)

set(VCPKG_CXX_FLAGS "-g")
set(VCPKG_C_FLAGS "-g")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ set(VCPKG_CMAKE_SYSTEM_NAME Linux)
# For AWS SDK. Remove after update from 1.74
set(VCPKG_CXX_FLAGS "-Wno-error=nonnull -Wno-error=deprecated-declarations")
set(VCPKG_C_FLAGS "-Wno-error=nonnull -Wno-error=deprecated-declarations")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-osx-asan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ set(VCPKG_OSX_ARCHITECTURES x86_64)

set(VCPKG_C_FLAGS "-fsanitize=address")
set(VCPKG_CXX_FLAGS "-fsanitize=address")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-osx-release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ set(VCPKG_OSX_ARCHITECTURES x86_64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

set(VCPKG_BUILD_TYPE release)

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-osx-relwithdebinfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

set(VCPKG_CXX_FLAGS "-g")
set(VCPKG_C_FLAGS "-g")

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
6 changes: 6 additions & 0 deletions ports/triplets/x64-osx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_OSX_ARCHITECTURES x86_64)
set(VCPKG_OSX_DEPLOYMENT_TARGET 11)

# Hide symbols in the AWS SDK. Fixes symbol collisions with other libraries
# like arrow (https://github.com/apache/arrow/issues/42154).
if("${PORT}" MATCHES "^aws-")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_CXX_VISIBILITY_PRESET=hidden;-DCMAKE_C_VISIBILITY_PRESET=hidden")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ struct ConsolidationWithTimestampsFx {
// Functions.
void set_legacy();
void create_sparse_array(bool allows_dups = false);
void create_sparse_array_v11();
void write_sparse(
std::vector<int> a1,
std::vector<uint64_t> dim1,
std::vector<uint64_t> dim2,
uint64_t timestamp);
void write_sparse_v11(uint64_t timestamp);
void consolidate_sparse(bool vacuum = false);
void consolidate_sparse(
uint64_t start_time, uint64_t end_time, bool vacuum = false);
Expand Down Expand Up @@ -160,18 +158,6 @@ void ConsolidationWithTimestampsFx::create_sparse_array(bool allows_dups) {
Array::create(SPARSE_ARRAY_NAME, schema);
}

void ConsolidationWithTimestampsFx::create_sparse_array_v11() {
// Get the v11 sparse array.
std::string v11_arrays_dir =
std::string(TILEDB_TEST_INPUTS_DIR) + "/arrays/sparse_array_v11";
REQUIRE(
tiledb_vfs_copy_dir(
ctx_.ptr().get(),
vfs_.ptr().get(),
v11_arrays_dir.c_str(),
SPARSE_ARRAY_NAME) == TILEDB_OK);
}

void ConsolidationWithTimestampsFx::write_sparse(
std::vector<int> a1,
std::vector<uint64_t> dim1,
Expand All @@ -195,37 +181,6 @@ void ConsolidationWithTimestampsFx::write_sparse(
array.close();
}

void ConsolidationWithTimestampsFx::write_sparse_v11(uint64_t timestamp) {
// Prepare cell buffers.
std::vector<int> buffer_a1{0, 1, 2, 3};
std::vector<uint64_t> buffer_a2{0, 1, 3, 6};
std::string buffer_var_a2("abbcccdddd");
std::vector<float> buffer_a3{0.1f, 0.2f, 1.1f, 1.2f, 2.1f, 2.2f, 3.1f, 3.2f};
std::vector<uint64_t> buffer_coords_dim1{1, 1, 1, 2};
std::vector<uint64_t> buffer_coords_dim2{1, 2, 4, 3};

// Open array.
Array array(ctx_, SPARSE_ARRAY_NAME, TILEDB_WRITE, timestamp);

// Create query.
Query query(ctx_, array, TILEDB_WRITE);
query.set_layout(TILEDB_GLOBAL_ORDER);
query.set_data_buffer("a1", buffer_a1);
query.set_data_buffer(
"a2", (void*)buffer_var_a2.c_str(), buffer_var_a2.size());
query.set_offsets_buffer("a2", buffer_a2);
query.set_data_buffer("a3", buffer_a3);
query.set_data_buffer("d1", buffer_coords_dim1);
query.set_data_buffer("d2", buffer_coords_dim2);

// Submit/finalize the query.
query.submit();
query.finalize();

// Close array.
array.close();
}

void ConsolidationWithTimestampsFx::consolidate_sparse(bool vacuum) {
auto config = ctx_.config();
Array::consolidate(ctx_, SPARSE_ARRAY_NAME, &config);
Expand Down
7 changes: 7 additions & 0 deletions test/src/test-cppapi-current-domain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ TEST_CASE_METHOD(
range = rect.range<int>(1);
CHECK(range[0] == 30);
CHECK(range[1] == 40);

// Check range dtype
CHECK(ndrect.range_dtype(0) == TILEDB_INT32);
CHECK(ndrect.range_dtype("x") == TILEDB_INT32);

// Check ndim api
CHECK(ndrect.dim_num() == 2);
}

TEST_CASE_METHOD(
Expand Down
13 changes: 7 additions & 6 deletions test/src/unit-capi-array_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2503,7 +2503,8 @@ TEST_CASE_METHOD(
tiledb_array_schema_get_current_domain(ctx_, schema, &crd) == TILEDB_OK);

uint32_t is_empty = 0;
REQUIRE(tiledb_current_domain_get_is_empty(crd, &is_empty) == TILEDB_OK);
REQUIRE(
tiledb_current_domain_get_is_empty(ctx_, crd, &is_empty) == TILEDB_OK);
CHECK(is_empty == 1);

REQUIRE(tiledb_current_domain_free(&crd) == TILEDB_OK);
Expand Down Expand Up @@ -2537,7 +2538,7 @@ TEST_CASE_METHOD(

tiledb_ndrectangle_t* ndr = nullptr;
REQUIRE(tiledb_ndrectangle_alloc(ctx_, domain, &ndr) == TILEDB_OK);
REQUIRE(tiledb_current_domain_set_ndrectangle(crd, ndr) == TILEDB_OK);
REQUIRE(tiledb_current_domain_set_ndrectangle(ctx_, crd, ndr) == TILEDB_OK);

REQUIRE(
tiledb_array_schema_set_current_domain(ctx_, schema, crd) == TILEDB_OK);
Expand Down Expand Up @@ -2604,7 +2605,7 @@ TEST_CASE_METHOD(
REQUIRE(
tiledb_array_schema_get_current_domain(ctx_, schema, &crd) == TILEDB_OK);

REQUIRE(tiledb_current_domain_get_ndrectangle(crd, &ndr) == TILEDB_OK);
REQUIRE(tiledb_current_domain_get_ndrectangle(ctx_, crd, &ndr) == TILEDB_OK);
tiledb_range_t outrange;
REQUIRE(
tiledb_ndrectangle_get_range_from_name(ctx_, ndr, "d1", &outrange) ==
Expand Down Expand Up @@ -2672,7 +2673,7 @@ TEST_CASE_METHOD(
REQUIRE(
tiledb_ndrectangle_set_range_for_name(ctx_, ndr, "d1", &range) ==
TILEDB_OK);
REQUIRE(tiledb_current_domain_set_ndrectangle(crd, ndr) == TILEDB_OK);
REQUIRE(tiledb_current_domain_set_ndrectangle(ctx_, crd, ndr) == TILEDB_OK);
REQUIRE(
tiledb_array_schema_set_current_domain(ctx_, schema, crd) == TILEDB_OK);

Expand Down Expand Up @@ -2712,7 +2713,7 @@ TEST_CASE_METHOD(
REQUIRE(
tiledb_ndrectangle_set_range_for_name(ctx_, ndr, "d1", &range) ==
TILEDB_OK);
REQUIRE(tiledb_current_domain_set_ndrectangle(crd, ndr) == TILEDB_OK);
REQUIRE(tiledb_current_domain_set_ndrectangle(ctx_, crd, ndr) == TILEDB_OK);

REQUIRE(
tiledb_array_schema_evolution_expand_current_domain(ctx_, evo, crd) ==
Expand Down Expand Up @@ -2752,7 +2753,7 @@ TEST_CASE_METHOD(
REQUIRE(
tiledb_array_schema_get_current_domain(ctx_, schema, &crd) == TILEDB_OK);

REQUIRE(tiledb_current_domain_get_ndrectangle(crd, &ndr) == TILEDB_OK);
REQUIRE(tiledb_current_domain_get_ndrectangle(ctx_, crd, &ndr) == TILEDB_OK);
tiledb_range_t outrange;
REQUIRE(
tiledb_ndrectangle_get_range_from_name(ctx_, ndr, "d1", &outrange) ==
Expand Down
Loading

0 comments on commit 9479a81

Please sign in to comment.