@@ -226,39 +226,21 @@ fn canonicalize_utf8<I: NativePType>(
226226 let n_patch_buffers = values. buffers ( ) . len ( ) ;
227227 let mut buffers = values. buffers ( ) . to_vec ( ) ;
228228
229- let ( fill_view, _fill_validity ) = if let Some ( buffer) = & fill_value. value ( ) {
229+ let fill_view = if let Some ( buffer) = & fill_value. value ( ) {
230230 buffers. push ( buffer. inner ( ) . clone ( ) ) ;
231- let view = BinaryView :: make_view (
231+ BinaryView :: make_view (
232232 buffer. as_ref ( ) ,
233233 u32:: try_from ( n_patch_buffers) . vortex_expect ( "too many buffers" ) ,
234234 0 ,
235- ) ;
236- ( view, Validity :: AllValid )
235+ )
237236 } else {
238237 // any <12 character filler value will do
239- let view = BinaryView :: make_view ( "FILL_VALUE" . as_ref ( ) , 0 , 0 ) ;
240- ( view, Validity :: AllInvalid )
238+ BinaryView :: make_view ( "FILL_VALUE" . as_ref ( ) , 0 , 0 )
241239 } ;
240+
242241 let mut view_builder = BufferMut :: < BinaryView > :: with_capacity ( len) ;
243242 let mut i = 0usize ;
244- println ! ( "indices: {:?}" , indices. as_ref( ) ) ;
245- println ! ( "values: {:?}" , values. as_ref( ) ) ;
246243 for ( patch_index, & view) in indices. into_iter ( ) . zip_eq ( values. views ( ) . iter ( ) ) {
247- if view. is_inlined ( ) {
248- println ! (
249- "patch_index={}, i={}, view={:?}" ,
250- patch_index,
251- i,
252- view. as_inlined( ) . value( )
253- ) ;
254- } else {
255- println ! (
256- "patch_index={}, i={}, view={:?}" ,
257- patch_index,
258- i,
259- view. as_view( )
260- ) ;
261- }
262244 let patch_index_usize = <usize as NumCast >:: from ( patch_index)
263245 . vortex_expect ( "var bin view indices must fit in usize" ) ;
264246 for _ in i..patch_index_usize {
@@ -271,27 +253,6 @@ fn canonicalize_utf8<I: NativePType>(
271253 for _ in i..len {
272254 view_builder. push ( fill_view)
273255 }
274-
275- match & validity {
276- Validity :: NonNullable => println ! ( "validity: nonnull" ) ,
277- Validity :: AllValid => println ! ( "validity: allvalid" ) ,
278- Validity :: AllInvalid => println ! ( "validity: allinvalid" ) ,
279- Validity :: Array ( a) => {
280- println ! (
281- "validity: {}" ,
282- ( 0 ..a. len( ) )
283- . map( |i| a. scalar_at( i) . vortex_expect( "shutup" ) )
284- . map( |x| x
285- . as_bool( )
286- . value( )
287- . map_or( "N" , |b| if b { "T" } else { "F" } )
288- . to_owned( ) )
289- . join( " " )
290- ) ;
291- }
292- }
293-
294- // let validity = fill_validity.patch(len, 0, indices_array.as_ref(), &patch_validity)?;
295256 let array = VarBinViewArray :: try_new (
296257 view_builder. freeze ( ) ,
297258 buffers,
@@ -701,26 +662,6 @@ mod test {
701662 )
702663 . unwrap ( ) ;
703664
704- println ! (
705- "array: {}" ,
706- ( 0 ..array. len( ) )
707- . map( |i| array. scalar_at( i) . unwrap( ) )
708- . join( "," )
709- ) ;
710- let va = array. validity_mask ( ) . unwrap ( ) . into_array ( ) ;
711- println ! (
712- "array_validity: {}" ,
713- ( 0 ..va. len( ) )
714- . map( |i| va
715- . scalar_at( i)
716- . unwrap( )
717- . as_bool( )
718- . value( )
719- . map_or( "N" , |b| if b { "T" } else { "F" } )
720- . to_owned( ) )
721- . join( "," )
722- ) ;
723-
724665 let actual = array. to_varbinview ( ) . unwrap ( ) . into_array ( ) ;
725666 let expected = <VarBinViewArray as FromIterator < _ > >:: from_iter ( [
726667 Some ( "hello" ) ,
0 commit comments