Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #63 from Intel-HLS/dev
Browse files Browse the repository at this point in the history
Metadata bug fix
  • Loading branch information
stavrospapadopoulos authored Feb 17, 2017
2 parents 33ad035 + 3a151d1 commit 2d1fe95
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/include/c_api/tiledb_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <limits.h>

/** Version. */
#define TILEDB_VERSION "0.5.1"
#define TILEDB_VERSION "0.5.2"

/**@{*/
/** Return code. */
Expand Down
10 changes: 6 additions & 4 deletions core/src/array/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ Array::~Array() {
if(array_sorted_write_state_ != NULL)
delete array_sorted_write_state_;

// Applicable only to clones
// Applicable only to non-clones
if(array_clone_ != NULL) {
delete array_clone_;
} else { // Applicable only to (non-clone) arrays
if(array_schema_ != NULL)
delete array_schema_;
if(subarray_ != NULL)
Expand Down Expand Up @@ -604,10 +603,13 @@ int Array::init(

// For the case of the clone sparse array, append coordinates if they do
// not exist already
if(sparse && array_clone == NULL && !coords_found)
if(sparse &&
array_clone == NULL &&
!coords_found &&
!is_metadata(array_schema->array_name()))
attributes_vec.push_back(TILEDB_COORDS);
}

// Set attribute ids
if(array_schema->get_attribute_ids(attributes_vec, attribute_ids_)
!= TILEDB_AS_OK) {
Expand Down
6 changes: 3 additions & 3 deletions test/src/c_api/c_api_dense_array_spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ int DenseArrayTestFixture::write_dense_subarray_2D(


/**
* Tests 100 random 2D subarrays and checks if the value of each cell is equal
* Tests 10 random 2D subarrays and checks if the value of each cell is equal
* to row_id*dim1+col_id. Top left corner is always 4,4.
*/
TEST_F(DenseArrayTestFixture, test_random_dense_sorted_reads) {
Expand All @@ -501,7 +501,7 @@ TEST_F(DenseArrayTestFixture, test_random_dense_sorted_reads) {
int64_t capacity = 0; // 0 means use default capacity
int cell_order = TILEDB_ROW_MAJOR;
int tile_order = TILEDB_ROW_MAJOR;
int iter_num = 100;
int iter_num = 10;

// Set array name
set_array_name("dense_test_5000x10000_100x100");
Expand Down Expand Up @@ -601,7 +601,7 @@ TEST_F(DenseArrayTestFixture, test_random_dense_sorted_writes) {
int64_t capacity = 0; // 0 means use default capacity
int cell_order = TILEDB_ROW_MAJOR;
int tile_order = TILEDB_ROW_MAJOR;
int iter_num = 100;
int iter_num = 10;

// Set array name
set_array_name("dense_test_100x100_10x10");
Expand Down
4 changes: 2 additions & 2 deletions test/src/c_api/c_api_sparse_array_spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ int SparseArrayTestFixture::write_sparse_array_unsorted_2D(
* Test is to randomly read subregions of the array and
* check with corresponding value set by row_id*dim1+col_id
* Top left corner is always 4,4
* Test runs through 100 iterations to choose random
* Test runs through 10 iterations to choose random
* width and height of the subregions
*/
TEST_F(SparseArrayTestFixture, test_random_sparse_sorted_reads) {
Expand All @@ -292,7 +292,7 @@ TEST_F(SparseArrayTestFixture, test_random_sparse_sorted_reads) {
int64_t capacity = 0; // 0 means use default capacity
int cell_order = TILEDB_ROW_MAJOR;
int tile_order = TILEDB_ROW_MAJOR;
int iter_num = 100;
int iter_num = 10;

// Set array name
set_array_name("sparse_test_5000x1000_100x100");
Expand Down
3 changes: 2 additions & 1 deletion test/src/misc/utils_spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ TEST_F(UtilsTestFixture, test_RLE) {
value_size = sizeof(int);

// Test empty bufffer


rc = RLE_compress(input, input_size, compressed, compressed_size, value_size);
ASSERT_EQ(rc, 0);

Expand Down Expand Up @@ -184,7 +186,6 @@ TEST_F(UtilsTestFixture, test_RLE) {
run_size = value_size + 2;

// Test a mix of short and long runs
double dv = 0.234;
double j = 0.1, k = 0.2;
for(int i=0; i<10; ++i) {
j+= 10000.12;
Expand Down

0 comments on commit 2d1fe95

Please sign in to comment.