File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ use crate::arrays::List;
2323use crate :: arrays:: ListView ;
2424use crate :: arrays:: Masked ;
2525use crate :: arrays:: Null ;
26- use crate :: arrays:: Patched ;
2726use crate :: arrays:: Primitive ;
2827use crate :: arrays:: Struct ;
2928use crate :: arrays:: VarBin ;
@@ -80,7 +79,6 @@ impl Default for ArraySession {
8079 this. register ( Dict ) ;
8180 this. register ( List ) ;
8281 this. register ( Masked ) ;
83- this. register ( Patched ) ;
8482 this. register ( VarBin ) ;
8583
8684 this
Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ pub use footer::*;
109109pub use forever_constant:: * ;
110110pub use open:: * ;
111111pub use strategy:: * ;
112- use vortex_array:: arrays:: Dict ;
112+ use vortex_array:: arrays:: { Dict , Patched } ;
113+ use vortex_array:: arrays:: patched:: use_experimental_patches;
113114use vortex_array:: session:: ArraySessionExt ;
114115use vortex_bytebool:: ByteBool ;
115116use vortex_fsst:: FSST ;
@@ -168,6 +169,9 @@ pub fn register_default_encodings(session: &VortexSession) {
168169 arrays. register ( vortex_zstd:: Zstd ) ;
169170 #[ cfg( all( feature = "zstd" , feature = "unstable_encodings" ) ) ]
170171 arrays. register ( vortex_zstd:: ZstdBuffers ) ;
172+ if use_experimental_patches ( ) {
173+ arrays. register ( Patched ) ;
174+ }
171175 }
172176
173177 // Eventually all encodings crates should expose an initialize function. For now it's only
Original file line number Diff line number Diff line change @@ -90,10 +90,6 @@ pub static ALLOWED_ENCODINGS: LazyLock<HashSet<ArrayId>> = LazyLock::new(|| {
9090 allowed. insert ( Masked . id ( ) ) ;
9191 allowed. insert ( Dict . id ( ) ) ;
9292
93- if use_experimental_patches ( ) {
94- allowed. insert ( Patched . id ( ) ) ;
95- }
96-
9793 // Compressed encodings from encoding crates
9894 allowed. insert ( ALP . id ( ) ) ;
9995 allowed. insert ( ALPRD . id ( ) ) ;
@@ -111,6 +107,12 @@ pub static ALLOWED_ENCODINGS: LazyLock<HashSet<ArrayId>> = LazyLock::new(|| {
111107 allowed. insert ( Sparse . id ( ) ) ;
112108 allowed. insert ( ZigZag . id ( ) ) ;
113109
110+ // Experimental encodings
111+
112+ if use_experimental_patches ( ) {
113+ allowed. insert ( Patched . id ( ) ) ;
114+ }
115+
114116 #[ cfg( feature = "zstd" ) ]
115117 allowed. insert ( Zstd . id ( ) ) ;
116118 #[ cfg( all( feature = "zstd" , feature = "unstable_encodings" ) ) ]
Original file line number Diff line number Diff line change @@ -47,12 +47,12 @@ use vortex_session::SessionExt;
4747use vortex_session:: VortexSession ;
4848use vortex_session:: registry:: ReadContext ;
4949
50- use crate :: Footer ;
5150use crate :: MAGIC_BYTES ;
5251use crate :: WriteStrategyBuilder ;
5352use crate :: counting:: CountingVortexWrite ;
5453use crate :: footer:: FileStatistics ;
5554use crate :: segments:: writer:: BufferedSegmentSink ;
55+ use crate :: { ALLOWED_ENCODINGS , Footer } ;
5656
5757/// Configure a new writer, which can eventually be used to write an [`ArrayStream`] into a sink
5858/// that implements [`VortexWrite`].
@@ -147,7 +147,7 @@ impl VortexWriteOptions {
147147 // serialised array order is deterministic. The serialisation of arrays are done
148148 // parallel and with an empty context they can register their encodings to the context
149149 // in different order, changing the written bytes from run to run.
150- let ctx = ArrayContext :: new ( self . session . arrays ( ) . registry ( ) . ids ( ) . sorted ( ) . collect ( ) )
150+ let ctx = ArrayContext :: new ( ALLOWED_ENCODINGS . iter ( ) . cloned ( ) . sorted ( ) . collect ( ) )
151151 // Configure a registry just to ensure only known encodings are interned.
152152 . with_registry ( self . session . arrays ( ) . registry ( ) . clone ( ) ) ;
153153 let dtype = stream. dtype ( ) . clone ( ) ;
You can’t perform that action at this time.
0 commit comments