Skip to content

Commit

Permalink
Bug fix: schema evolution fix-to-var reads followup. (#5362)
Browse files Browse the repository at this point in the history
Schema evolution bug fix: Reads no longer fail after dropping a fixed
attribute and adding it back as var-sized.

Followup to #5321 to address a previously-missed case caught by
[TileDB-Inc/TileDB-Py/#2083](TileDB-Inc/TileDB-Py#2083)

[sc-55085]

---
TYPE: BUG
DESC: Schema evolution bug fix: Reads no longer fail after dropping a
fixed attribute and adding it back as var-sized, part 2.
  • Loading branch information
bekadavis9 authored Nov 12, 2024
1 parent b224aee commit abca93c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tiledb/sm/query/readers/reader_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ uint64_t ReaderBase::offsets_bytesize() const {
uint64_t ReaderBase::get_attribute_tile_size(
const std::string& name, unsigned f, uint64_t t) const {
uint64_t tile_size = 0;
if (!fragment_metadata_[f]->array_schema()->is_field(name)) {
if (skip_field(f, name)) {
return tile_size;
}

Expand All @@ -1148,8 +1148,7 @@ uint64_t ReaderBase::get_attribute_tile_size(
* contains fixed tiles. The tile_var_size should be calculated iff
* both the current _and_ loaded attributes are var-sized.
*/
if (array_schema_.var_size(name) &&
fragment_metadata_[f]->array_schema()->var_size(name)) {
if (array_schema_.var_size(name)) {
tile_size +=
fragment_metadata_[f]->loaded_metadata()->tile_var_size(name, t);
}
Expand All @@ -1165,13 +1164,10 @@ uint64_t ReaderBase::get_attribute_tile_size(
uint64_t ReaderBase::get_attribute_persisted_tile_size(
const std::string& name, unsigned f, uint64_t t) const {
uint64_t tile_size = 0;
if (!fragment_metadata_[f]->array_schema()->is_field(name)) {
if (skip_field(f, name)) {
return tile_size;
}

tile_size +=
fragment_metadata_[f]->loaded_metadata()->persisted_tile_size(name, t);

if (array_schema_.var_size(name)) {
tile_size +=
fragment_metadata_[f]->loaded_metadata()->persisted_tile_var_size(
Expand Down

0 comments on commit abca93c

Please sign in to comment.