Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion vortex-array/src/arrays/patched/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ mod tests {
use crate::patches::Patches;
use crate::serde::SerializeOptions;
use crate::serde::SerializedArray;
use crate::session::ArraySessionExt;
use crate::validity::Validity;

#[test]
Expand Down Expand Up @@ -588,7 +589,9 @@ mod tests {
let dtype = array.dtype().clone();
let len = array.len();

let ctx = ArrayContext::empty();
LEGACY_SESSION.arrays().register(Patched);

let ctx = ArrayContext::empty().with_registry(LEGACY_SESSION.arrays().registry().clone());
let serialized = array
.serialize(&ctx, &LEGACY_SESSION, &SerializeOptions::default())
.unwrap();
Expand Down
2 changes: 0 additions & 2 deletions vortex-array/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::arrays::List;
use crate::arrays::ListView;
use crate::arrays::Masked;
use crate::arrays::Null;
use crate::arrays::Patched;
use crate::arrays::Primitive;
use crate::arrays::Struct;
use crate::arrays::VarBin;
Expand Down Expand Up @@ -80,7 +79,6 @@ impl Default for ArraySession {
this.register(Dict);
this.register(List);
this.register(Masked);
this.register(Patched);
this.register(VarBin);

this
Expand Down
5 changes: 5 additions & 0 deletions vortex-file/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub use forever_constant::*;
pub use open::*;
pub use strategy::*;
use vortex_array::arrays::Dict;
use vortex_array::arrays::Patched;
use vortex_array::arrays::patched::use_experimental_patches;
use vortex_array::session::ArraySessionExt;
use vortex_bytebool::ByteBool;
use vortex_fsst::FSST;
Expand Down Expand Up @@ -168,6 +170,9 @@ pub fn register_default_encodings(session: &VortexSession) {
arrays.register(vortex_zstd::Zstd);
#[cfg(all(feature = "zstd", feature = "unstable_encodings"))]
arrays.register(vortex_zstd::ZstdBuffers);
if use_experimental_patches() {
arrays.register(Patched);
}
}

// Eventually all encodings crates should expose an initialize function. For now it's only
Expand Down
10 changes: 6 additions & 4 deletions vortex-file/src/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ pub static ALLOWED_ENCODINGS: LazyLock<HashSet<ArrayId>> = LazyLock::new(|| {
allowed.insert(Masked.id());
allowed.insert(Dict.id());

if use_experimental_patches() {
allowed.insert(Patched.id());
}

// Compressed encodings from encoding crates
allowed.insert(ALP.id());
allowed.insert(ALPRD.id());
Expand All @@ -111,6 +107,12 @@ pub static ALLOWED_ENCODINGS: LazyLock<HashSet<ArrayId>> = LazyLock::new(|| {
allowed.insert(Sparse.id());
allowed.insert(ZigZag.id());

// Experimental encodings

if use_experimental_patches() {
allowed.insert(Patched.id());
}

#[cfg(feature = "zstd")]
allowed.insert(Zstd.id());
#[cfg(all(feature = "zstd", feature = "unstable_encodings"))]
Expand Down
3 changes: 2 additions & 1 deletion vortex-file/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use vortex_session::SessionExt;
use vortex_session::VortexSession;
use vortex_session::registry::ReadContext;

use crate::ALLOWED_ENCODINGS;
use crate::Footer;
use crate::MAGIC_BYTES;
use crate::WriteStrategyBuilder;
Expand Down Expand Up @@ -147,7 +148,7 @@ impl VortexWriteOptions {
// serialised array order is deterministic. The serialisation of arrays are done
// parallel and with an empty context they can register their encodings to the context
// in different order, changing the written bytes from run to run.
let ctx = ArrayContext::new(self.session.arrays().registry().ids().sorted().collect())
let ctx = ArrayContext::new(ALLOWED_ENCODINGS.iter().cloned().sorted().collect())
// Configure a registry just to ensure only known encodings are interned.
.with_registry(self.session.arrays().registry().clone());
let dtype = stream.dtype().clone();
Expand Down
4 changes: 2 additions & 2 deletions vortex-python/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl PyVortexWriteOptions {
/// >>> vx.io.VortexWriteOptions.default().write(sprl, "chonky.vortex")
/// >>> import os
/// >>> os.path.getsize('chonky.vortex')
/// 216036
/// 215972
/// ```
///
/// Wow, Vortex manages to use about two bytes per integer! So advanced. So tiny.
Expand All @@ -292,7 +292,7 @@ impl PyVortexWriteOptions {
/// ```python
/// >>> vx.io.VortexWriteOptions.compact().write(sprl, "tiny.vortex")
/// >>> os.path.getsize('tiny.vortex')
/// 55152
/// 55088
/// ```
///
/// Random numbers are not (usually) composed of random bytes!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ pub fn fixtures() -> Vec<Box<dyn FlatLayoutFixture>> {
Box::new(dict::DictFixture),
Box::new(fsst::FsstFixture),
Box::new(for_::FoRFixture),
Box::new(patched::PatchedFixture),
// TODO(aduffy): add back once we stabilized Patched array
// Box::new(patched::PatchedFixture),
Box::new(pco::PcoFixture),
Box::new(rle::RleFixture),
Box::new(runend::RunEndFixture),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ use vortex_session::VortexSession;

use crate::fixtures::FlatLayoutFixture;

#[expect(
dead_code,
reason = "This will be unused until we stabilize Patched array"
)]
pub struct PatchedFixture;

impl FlatLayoutFixture for PatchedFixture {
Expand Down
Loading