Skip to content

Commit

Permalink
copy array - nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
grammaright committed Oct 5, 2024
1 parent 6a7c038 commit 689db38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/copy_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ void GlobalWriteArrayData::pin(vector<uint64_t> _tile_coords) {

buf_size = page->pagebuf_len / sizeof(double);
buf = (double *)bf_util_get_pagebuf(page);

// nullbits set to 0 if it is the first time to pin the tile
if (page->type == DENSE_FIXED_NULLABLE
|| page->type == SPARSE_FIXED_NULLABLE) {
bool is_first = pinned_tiles.find(_tile_coords) == pinned_tiles.end();
if (is_first) {
bf_util_set_nullbits_null(page);

// push to pinned tiles
pinned_tiles.insert(_tile_coords);
}
}

is_pinned = true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/include/copy_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ struct GlobalWriteArrayData : public GlobalFunctionData {
private:
array_key key;
char *arrname_char;

// to check the tile has been pinned to set nullbits
set<vector<uint64_t>> pinned_tiles;
};

struct LocalWriteArrayData : public LocalFunctionData {};
Expand Down

0 comments on commit 689db38

Please sign in to comment.