MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / set_domain

Method set_domain

tiledb/sm/array_schema/array_schema.cc:1433–1474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1431}
1432
1433void ArraySchema::set_domain(shared_ptr<Domain> domain) {
1434 if (domain == nullptr) {
1435 throw ArraySchemaException("Cannot set domain; Input domain is nullptr");
1436 }
1437
1438 if (domain->dim_num() == 0) {
1439 throw ArraySchemaException(
1440 "Cannot set domain; Domain must contain at least one dimension");
1441 }
1442
1443 if (array_type_ == ArrayType::DENSE) {
1444 if (!domain->all_dims_same_type()) {
1445 throw ArraySchemaException(
1446 "Cannot set domain; In dense arrays, all "
1447 "dimensions must have the same datatype");
1448 }
1449
1450 auto type{domain->dimension_ptr(0)->type()};
1451 if (!datatype_is_integer(type) && !datatype_is_datetime(type) &&
1452 !datatype_is_time(type)) {
1453 throw ArraySchemaException(
1454 std::string("Cannot set domain; Dense arrays "
1455 "do not support dimension datatype '") +
1456 datatype_str(type) + "'");
1457 }
1458 }
1459
1460 if (cell_order_ != Layout::HILBERT) {
1461 domain->set_null_tile_extents_to_range();
1462 }
1463
1464 // Set domain
1465 domain_ = domain;
1466
1467 // Create dimension map
1468 dim_map_.clear();
1469 auto dim_num = domain_->dim_num();
1470 for (dimension_size_type d = 0; d < dim_num; ++d) {
1471 auto dim{dimension_ptr(d)};
1472 dim_map_[dim->name()] = dim;
1473 }
1474}
1475
1476void ArraySchema::set_tile_order(Layout tile_order) {
1477 if (tile_order == Layout::HILBERT) {

Callers 1

expand_current_domainMethod · 0.45

Calls 11

datatype_is_integerFunction · 0.85
datatype_is_datetimeFunction · 0.85
datatype_is_timeFunction · 0.85
dim_numMethod · 0.45
all_dims_same_typeMethod · 0.45
typeMethod · 0.45
dimension_ptrMethod · 0.45
clearMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected