diff --git a/libtiledbsoma/src/utils/arrow_adapter.cc b/libtiledbsoma/src/utils/arrow_adapter.cc index a3aaea4789..2553ca5f6b 100644 --- a/libtiledbsoma/src/utils/arrow_adapter.cc +++ b/libtiledbsoma/src/utils/arrow_adapter.cc @@ -1550,148 +1550,6 @@ ArrowAdapter::to_arrow(std::shared_ptr column) { return std::pair(std::move(array), std::move(schema)); } -void ArrowAdapter::set_current_domain_slot( - tiledb_datatype_t type, - const void* buff, - NDRectangle& ndrect, - std::string name) { - switch (type) { - case TILEDB_STRING_ASCII: - // Core domain must not be set for string dims. - // Core current_domain can't _not_ be set for string dims. - // For TileDB-SOMA, we set a broad initial range for string - // dims (because we have to) but there has never been support - // for user specification of domain for string dims, and we do not - // introduce support for user specification of current domain for - // string dims. - throw TileDBSOMAError( - "Internal error: _set_current_domain_slot must not be called " - "for string dimensions."); - break; - case TILEDB_TIME_SEC: - case TILEDB_TIME_MS: - case TILEDB_TIME_US: - case TILEDB_TIME_NS: - case TILEDB_DATETIME_SEC: - case TILEDB_DATETIME_MS: - case TILEDB_DATETIME_US: - case TILEDB_DATETIME_NS: { - uint64_t lo = ((uint64_t*)buff)[3]; - uint64_t hi = ((uint64_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain uint64_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_INT8: { - int8_t lo = ((int8_t*)buff)[3]; - int8_t hi = ((int8_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain int8_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_UINT8: { - uint8_t lo = ((uint8_t*)buff)[3]; - uint8_t hi = ((uint8_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain uint8_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_INT16: { - int16_t lo = ((int16_t*)buff)[3]; - int16_t hi = ((int16_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain int16_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_UINT16: { - uint16_t lo = ((uint16_t*)buff)[3]; - uint16_t hi = ((uint16_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain uint16_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_INT32: { - int32_t lo = ((int32_t*)buff)[3]; - int32_t hi = ((int32_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain int32_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_UINT32: { - uint32_t lo = ((uint32_t*)buff)[3]; - uint32_t hi = ((uint32_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain uint32_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_INT64: { - int64_t lo = ((int64_t*)buff)[3]; - int64_t hi = ((int64_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain int64_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_UINT64: { - uint64_t lo = ((uint64_t*)buff)[3]; - uint64_t hi = ((uint64_t*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain uint64_t {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_FLOAT32: { - float lo = ((float*)buff)[3]; - float hi = ((float*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain float {} to {}", - name, - lo, - hi)); - } break; - case TILEDB_FLOAT64: { - double lo = ((double*)buff)[3]; - double hi = ((double*)buff)[4]; - ndrect.set_range(name, lo, hi); - LOG_DEBUG(std::format( - "[ArrowAdapter] {} current_domain double {} to {}", - name, - lo, - hi)); - } break; - default: - throw TileDBSOMAError(std::format( - "ArrowAdapter: Unsupported TileDB dimension: {} ", - tiledb::impl::type_to_str(type))); - } -} - bool ArrowAdapter::arrow_is_var_length_type(const char* format) { return ( (strcmp(format, "U") == 0) || (strcmp(format, "Z") == 0) || @@ -1995,46 +1853,4 @@ ArrowArray* ArrowAdapter::_get_and_check_column( return child; } -void ArrowAdapter::_set_spatial_dimensions( - std::map& dims, - const ArrowTable& spatial_column_info, - std::string_view type_metadata, - std::string soma_type, - std::shared_ptr ctx, - PlatformConfig platform_config) { - if (type_metadata.compare("WKB") != 0) { - throw TileDBSOMAError(std::format( - "ArrowAdapter::tiledb_attribute_from_arrow_schema: " - "Unkwown type metadata for `{}`: " - "Expected 'WKB', got {}", - SOMA_GEOMETRY_COLUMN_NAME, - type_metadata)); - } - - for (int64_t j = 0; j < spatial_column_info.second->n_children; ++j) { - auto min_dim = tiledb_dimension_from_arrow_schema( - ctx, - spatial_column_info.second->children[j], - spatial_column_info.first->children[j], - soma_type, - type_metadata, - SOMA_GEOMETRY_DIMENSION_PREFIX, - "__min", - platform_config); - - auto max_dim = tiledb_dimension_from_arrow_schema( - ctx, - spatial_column_info.second->children[j], - spatial_column_info.first->children[j], - soma_type, - type_metadata, - SOMA_GEOMETRY_DIMENSION_PREFIX, - "__max", - platform_config); - - dims.insert({min_dim.name(), min_dim}); - dims.insert({max_dim.name(), max_dim}); - } -} - } // namespace tiledbsoma diff --git a/libtiledbsoma/src/utils/arrow_adapter.h b/libtiledbsoma/src/utils/arrow_adapter.h index 86fe077f39..7992624e2f 100644 --- a/libtiledbsoma/src/utils/arrow_adapter.h +++ b/libtiledbsoma/src/utils/arrow_adapter.h @@ -968,12 +968,6 @@ class ArrowAdapter { } } - static void set_current_domain_slot( - tiledb_datatype_t type, - const void* buff, - NDRectangle& ndrect, - std::string name); - private: static std::pair _get_data_and_length( Enumeration& enmr, const void* dst); @@ -1054,13 +1048,6 @@ class ArrowAdapter { int64_t column_index, int64_t expected_n_buffers); - static void _set_spatial_dimensions( - std::map& dims, - const ArrowTable& spatial_column_info, - std::string_view type_metadata, - std::string soma_type, - std::shared_ptr ctx, - PlatformConfig platform_config); }; // class ArrowAdapter }; // namespace tiledbsoma #endif