Skip to content

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
XanthosXanthopoulos committed Dec 13, 2024
1 parent 5d9e253 commit d6d6187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 201 deletions.
192 changes: 4 additions & 188 deletions libtiledbsoma/src/utils/arrow_adapter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,8 @@ void ArrowAdapter::_set_current_domain_slot(
LOG_DEBUG(std::format(
"[ArrowAdapter] {} current_domain float {} to {}",
name,
std::to_string(lo),
std::to_string(hi)));
lo,
hi));
} break;
case TILEDB_FLOAT64: {
double lo = ((double*)buff)[3];
Expand All @@ -963,8 +963,8 @@ void ArrowAdapter::_set_current_domain_slot(
LOG_DEBUG(std::format(
"[ArrowAdapter] {} current_domain double {} to {}",
name,
std::to_string(lo),
std::to_string(hi)));
lo,
hi));
} break;
default:
throw TileDBSOMAError(std::format(
Expand Down Expand Up @@ -1550,148 +1550,6 @@ ArrowAdapter::to_arrow(std::shared_ptr<ColumnBuffer> 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<uint64_t>(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<int8_t>(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<uint8_t>(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<int16_t>(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<uint16_t>(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<int32_t>(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<uint32_t>(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<int64_t>(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<uint64_t>(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<float>(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<double>(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) ||
Expand Down Expand Up @@ -1995,46 +1853,4 @@ ArrowArray* ArrowAdapter::_get_and_check_column(
return child;
}

void ArrowAdapter::_set_spatial_dimensions(
std::map<std::string, Dimension>& dims,
const ArrowTable& spatial_column_info,
std::string_view type_metadata,
std::string soma_type,
std::shared_ptr<Context> 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
13 changes: 0 additions & 13 deletions libtiledbsoma/src/utils/arrow_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<const void*, std::size_t> _get_data_and_length(
Enumeration& enmr, const void* dst);
Expand Down Expand Up @@ -1054,13 +1048,6 @@ class ArrowAdapter {
int64_t column_index,
int64_t expected_n_buffers);

static void _set_spatial_dimensions(
std::map<std::string, Dimension>& dims,
const ArrowTable& spatial_column_info,
std::string_view type_metadata,
std::string soma_type,
std::shared_ptr<Context> ctx,
PlatformConfig platform_config);
}; // class ArrowAdapter
}; // namespace tiledbsoma
#endif

0 comments on commit d6d6187

Please sign in to comment.