Skip to content

Commit

Permalink
Remove ValidityVector::init_bytemap.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Apr 28, 2023
1 parent 7af5c2c commit d796b16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
4 changes: 0 additions & 4 deletions tiledb/common/exception/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ inline Status Status_BufferError(const std::string& msg) {
inline Status Status_QueryError(const std::string& msg) {
return {"[TileDB::Query] Error", msg};
}
/** Return a ValidityVector error class Status with a given message **/
inline Status Status_ValidityVectorError(const std::string& msg) {
return {"[TileDB::ValidityVector] Error", msg};
}
/** Return a Status_VFSError error class Status with a given message **/
inline Status Status_VFSError(const std::string& msg) {
return {"[TileDB::VFS] Error", msg};
Expand Down
10 changes: 4 additions & 6 deletions tiledb/sm/query/query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1516,17 +1516,14 @@ Status Query::set_validity_buffer(
const bool serialization_allow_new_attr) {
RETURN_NOT_OK(check_set_fixed_buffer(name));

ValidityVector validity_vector;
RETURN_NOT_OK(validity_vector.init_bytemap(
buffer_validity_bytemap, buffer_validity_bytemap_size));
// Check validity buffer
if (check_null_buffers && validity_vector.buffer() == nullptr) {
if (check_null_buffers && buffer_validity_bytemap == nullptr) {
return logger_->status(Status_QueryError(
"Cannot set buffer; " + name + " validity buffer is null"));
}

// Check validity buffer size
if (check_null_buffers && validity_vector.buffer_size() == nullptr) {
if (check_null_buffers && buffer_validity_bytemap_size == nullptr) {
return logger_->status(Status_QueryError(
"Cannot set buffer; " + name + " validity buffer size is null"));
}
Expand Down Expand Up @@ -1561,7 +1558,8 @@ Status Query::set_validity_buffer(
}

// Set attribute/dimension buffer
buffers_[name].set_validity_buffer(std::move(validity_vector));
buffers_[name].set_validity_buffer(
{buffer_validity_bytemap, buffer_validity_bytemap_size});

return Status::Ok();
}
Expand Down
21 changes: 0 additions & 21 deletions tiledb/sm/query/validity_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <vector>

#include "tiledb/common/macros.h"
#include "tiledb/common/status.h"

using namespace tiledb::common;

Expand Down Expand Up @@ -97,26 +96,6 @@ class ValidityVector {
/* API */
/* ********************************* */

/**
* Initializes the validity vector with a bytemap. This does
* not take ownership of the bytemap. Each non-zero byte represents
* a valid attribute value.
*
* @param bytemap The byte map.
* @param bytemap_size The byte size of `bytemap`.
* @return Status
*/
Status init_bytemap(uint8_t* const bytemap, uint64_t* bytemap_size) {
if (buffer_ != nullptr)
return Status_ValidityVectorError(
"ValidityVector instance already initialized");

buffer_ = bytemap;
buffer_size_ = bytemap_size;

return Status::Ok();
}

/** Returns the bytemap that this instance was initialized with. */
uint8_t* bytemap() const {
return buffer_;
Expand Down

0 comments on commit d796b16

Please sign in to comment.