Skip to content

Commit 3d1553e

Browse files
committed
less
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 989283b commit 3d1553e

5 files changed

Lines changed: 12 additions & 37 deletions

File tree

encodings/fastlanes/src/bitpacking/vtable/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,6 @@ impl VTable for BitPacked {
252252
}
253253

254254
fn serialize(metadata: Self::Metadata) -> VortexResult<Option<Vec<u8>>> {
255-
vortex_ensure!(
256-
metadata.offset == 0,
257-
"BitPackedArray offset must be 0 for serialization, got {}",
258-
metadata.offset
259-
);
260-
if let Some(ref patches) = metadata.patches {
261-
vortex_ensure!(
262-
patches.offset()? == 0,
263-
"BitPackedArray patches offset must be 0 for serialization, got {}",
264-
patches.offset()?
265-
);
266-
}
267255
Ok(Some(metadata.serialize()))
268256
}
269257

encodings/fastlanes/src/delta/vtable/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,6 @@ impl VTable for Delta {
157157
}
158158

159159
fn serialize(metadata: Self::Metadata) -> VortexResult<Option<Vec<u8>>> {
160-
vortex_ensure!(
161-
metadata.offset == 0,
162-
"DeltaArray offset must be 0 for serialization, got {}",
163-
metadata.offset
164-
);
165160
Ok(Some(metadata.0.encode_to_vec()))
166161
}
167162

encodings/fastlanes/src/rle/array/mod.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -504,16 +504,18 @@ mod tests {
504504
let concat = concat.freeze();
505505

506506
let parts = ArrayParts::try_from(concat).unwrap();
507-
let decoded = parts.decode(
508-
sliced.dtype(),
509-
sliced.len(),
510-
&ReadContext::new(ctx.to_ids()),
511-
&SESSION,
512-
);
507+
let decoded = parts
508+
.decode(
509+
sliced.dtype(),
510+
sliced.len(),
511+
&ReadContext::new(ctx.to_ids()),
512+
&SESSION,
513+
)
514+
.unwrap();
513515

514-
assert_eq!(
515-
decoded.err().unwrap().to_string(),
516-
"Other error: RLEArray offset must be 0 for serialization, got 100"
517-
);
516+
let original_data = sliced.to_primitive();
517+
let decoded_data = decoded.to_primitive();
518+
519+
assert_arrays_eq!(original_data, decoded_data);
518520
}
519521
}

encodings/fastlanes/src/rle/vtable/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,6 @@ impl VTable for RLE {
176176
}
177177

178178
fn serialize(metadata: Self::Metadata) -> VortexResult<Option<Vec<u8>>> {
179-
vortex_ensure!(
180-
metadata.offset == 0,
181-
"RLEArray offset must be 0 for serialization, got {}",
182-
metadata.offset
183-
);
184179
Ok(Some(metadata.0.encode_to_vec()))
185180
}
186181

encodings/runend/src/array.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ impl VTable for RunEnd {
142142
}
143143

144144
fn serialize(metadata: Self::Metadata) -> VortexResult<Option<Vec<u8>>> {
145-
vortex_ensure!(
146-
metadata.offset == 0,
147-
"RunEndArray offset must be 0 for serialization, got {}",
148-
metadata.offset
149-
);
150145
Ok(Some(metadata.serialize()))
151146
}
152147

0 commit comments

Comments
 (0)