diff --git a/libtiledbsoma/src/soma/soma_array.cc b/libtiledbsoma/src/soma/soma_array.cc index 9fe4d0db7c..0ea3ef4205 100644 --- a/libtiledbsoma/src/soma/soma_array.cc +++ b/libtiledbsoma/src/soma/soma_array.cc @@ -724,12 +724,13 @@ std::vector SOMAArray::shape() { // * Even after the new-shape feature is fully released, there will be old // arrays on disk that were created before this feature existed. // So this is long-term code. - return _get_current_domain().is_empty() ? _tiledb_domain() : - _tiledb_current_domain(); + return _get_current_domain().is_empty() ? + _shape_via_tiledb_domain() : + _shape_via_tiledb_current_domain(); } std::vector SOMAArray::maxshape() { - return _tiledb_domain(); + return _shape_via_tiledb_domain(); } // This is a helper for can_upgrade_shape and can_resize, which have @@ -1530,7 +1531,7 @@ void SOMAArray::_set_domain_helper( schema_evolution.array_evolve(uri_); } -std::vector SOMAArray::_tiledb_current_domain() { +std::vector SOMAArray::_shape_via_tiledb_current_domain() { // Variant-indexed dataframes must use a separate path _check_dims_are_int64(); @@ -1555,12 +1556,12 @@ std::vector SOMAArray::_tiledb_current_domain() { for (auto dimension_name : dimension_names()) { auto range = ndrect.range(dimension_name); - result.push_back(range[1] + 1); + result.push_back(range[1] - range[0] + 1); } return result; } -std::vector SOMAArray::_tiledb_domain() { +std::vector SOMAArray::_shape_via_tiledb_domain() { // Variant-indexed dataframes must use a separate path _check_dims_are_int64(); @@ -1577,15 +1578,16 @@ std::vector SOMAArray::_tiledb_domain() { std::optional SOMAArray::_maybe_soma_joinid_shape() { return _get_current_domain().is_empty() ? - _maybe_soma_joinid_tiledb_domain() : - _maybe_soma_joinid_tiledb_current_domain(); + _maybe_soma_joinid_shape_via_tiledb_domain() : + _maybe_soma_joinid_shape_via_tiledb_current_domain(); } std::optional SOMAArray::_maybe_soma_joinid_maxshape() { - return _maybe_soma_joinid_tiledb_domain(); + return _maybe_soma_joinid_shape_via_tiledb_domain(); } -std::optional SOMAArray::_maybe_soma_joinid_tiledb_current_domain() { +std::optional +SOMAArray::_maybe_soma_joinid_shape_via_tiledb_current_domain() { const std::string dim_name = "soma_joinid"; auto dom = schema_->domain(); @@ -1619,7 +1621,7 @@ std::optional SOMAArray::_maybe_soma_joinid_tiledb_current_domain() { return std::optional(max); } -std::optional SOMAArray::_maybe_soma_joinid_tiledb_domain() { +std::optional SOMAArray::_maybe_soma_joinid_shape_via_tiledb_domain() { const std::string dim_name = "soma_joinid"; auto dom = schema_->domain(); diff --git a/libtiledbsoma/src/soma/soma_array.h b/libtiledbsoma/src/soma/soma_array.h index 403fcb3bb5..bd20479488 100644 --- a/libtiledbsoma/src/soma/soma_array.h +++ b/libtiledbsoma/src/soma/soma_array.h @@ -1530,10 +1530,10 @@ class SOMAArray : public SOMAObject { * * Here we distinguish between user-side API, and core-side implementation. */ - std::vector _tiledb_domain(); - std::vector _tiledb_current_domain(); - std::optional _maybe_soma_joinid_tiledb_current_domain(); - std::optional _maybe_soma_joinid_tiledb_domain(); + std::vector _shape_via_tiledb_domain(); + std::vector _shape_via_tiledb_current_domain(); + std::optional _maybe_soma_joinid_shape_via_tiledb_current_domain(); + std::optional _maybe_soma_joinid_shape_via_tiledb_domain(); void fill_metadata_cache(std::optional timestamp);