File tree Expand file tree Collapse file tree
encodings/parquet-variant/src
aggregate_fn/fns/uncompressed_size_in_bytes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -466,7 +466,9 @@ mod tests {
466466 None ,
467467 )
468468 . unwrap ( ) ;
469- let typed_value = VariantArray :: new ( inner_pv. into_array ( ) ) . into_array ( ) ;
469+ let typed_value = VariantArray :: try_new ( inner_pv. into_array ( ) , None )
470+ . unwrap ( )
471+ . into_array ( ) ;
470472
471473 let outer_pv = ParquetVariant :: try_new (
472474 Validity :: NonNullable ,
Original file line number Diff line number Diff line change @@ -23004,8 +23004,6 @@ pub fn vortex_array::Array<vortex_array::arrays::VarBinView>::try_new(vortex_buf
2300423004
2300523005impl vortex_array::Array<vortex_array::arrays::Variant>
2300623006
23007- pub fn vortex_array::Array<vortex_array::arrays::Variant>::new(vortex_array::ArrayRef) -> Self
23008-
2300923007pub fn vortex_array::Array<vortex_array::arrays::Variant>::try_new(vortex_array::ArrayRef, core::option::Option<vortex_array::ArrayRef>) -> vortex_error::VortexResult<Self>
2301023008
2301123009impl vortex_array::Array<vortex_array::arrays::dict::Dict>
Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ mod tests {
548548 #[ test]
549549 fn variant_stat_is_unsupported ( ) -> VortexResult < ( ) > {
550550 let child = ConstantArray :: new ( Scalar :: variant ( Scalar :: from ( 42i32 ) ) , 3 ) . into_array ( ) ;
551- let array = VariantArray :: new ( child) . into_array ( ) ;
551+ let array = VariantArray :: try_new ( child, None ) ? . into_array ( ) ;
552552 let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
553553
554554 assert_eq ! (
Original file line number Diff line number Diff line change @@ -165,9 +165,10 @@ pub(crate) fn constant_canonicalize(
165165 } )
166166 }
167167 DType :: Union ( ..) => todo ! ( "TODO(connor)[Union]: unimplemented" ) ,
168- DType :: Variant ( _) => {
169- Canonical :: Variant ( VariantArray :: new ( array. array ( ) . clone ( ) . into_array ( ) ) )
170- }
168+ DType :: Variant ( _) => Canonical :: Variant ( VariantArray :: try_new (
169+ array. array ( ) . clone ( ) . into_array ( ) ,
170+ None ,
171+ ) ?) ,
171172 DType :: Extension ( ext_dtype) => {
172173 let s = scalar. as_extension ( ) ;
173174
Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ impl<T: TypedArrayRef<Variant>> VariantArrayExt for T {}
5151
5252impl Array < Variant > {
5353 /// Creates a new `VariantArray` with logical variant core storage and optional shredded storage.
54+ ///
55+ /// `core_storage` must have `DType::Variant`, but it may use any Variant-typed physical
56+ /// encoding. See [`VariantArrayExt`] for the higher-level storage contract.
57+ ///
58+ /// `shredded`, when present, must be row-aligned with `core_storage` and stores typed values for
59+ /// selected variant paths.
5460 pub fn try_new ( core_storage : ArrayRef , shredded : Option < ArrayRef > ) -> VortexResult < Self > {
5561 let dtype = core_storage. dtype ( ) . clone ( ) ;
5662 vortex_ensure ! (
@@ -65,11 +71,6 @@ impl Array<Variant> {
6571 ) ?
6672 . with_stats_set ( stats) )
6773 }
68-
69- /// Creates a new `VariantArray`.
70- pub fn new ( core_storage : ArrayRef ) -> Self {
71- Self :: try_new ( core_storage, None ) . vortex_expect ( "invalid VariantArray core_storage" )
72- }
7374}
7475
7576#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments