Skip to content

Commit 4d4752e

Browse files
AdamGSdimitarvdimitrov
authored andcommitted
Add backwards compatibly handling of sum stats of extension types (#7014)
After #6910, Older files with extension types will have zone stats that are just based on the storage type (which might be arbitrary) and which is rarely useful. we currently don't handle its existence at all, so reading these files might panic or otherwise error. This PR falls back to the storage type on the read path, but might not be the desirable solution. Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 82211a5 commit 4d4752e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

vortex-layout/src/layouts/zoned/zone_map.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ impl ZoneMap {
8080
.iter()
8181
.filter_map(|stat| {
8282
stat.dtype(column_dtype)
83+
.or_else(|| {
84+
// Backward compat: older files may have stored stats (e.g. Sum)
85+
// for extension types by resolving through the storage dtype.
86+
if let DType::Extension(ext) = column_dtype {
87+
stat.dtype(ext.storage_dtype())
88+
} else {
89+
None
90+
}
91+
})
8392
.map(|dtype| (stat, dtype.as_nullable()))
8493
})
8594
.flat_map(|(s, dt)| match s {

0 commit comments

Comments
 (0)