File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1739,14 +1739,20 @@ fn encode_column(
17391739 offsets : offsets_buf,
17401740 mode,
17411741 } => {
1742- let _union_array = column . as_any ( ) . downcast_ref :: < UnionArray > ( ) . unwrap ( ) ;
1743- let null_sentinel = if opts. descending { 0x00 } else { 0x01 } ;
1742+ let union_array = as_union_array ( column ) ;
1743+ let null_sentinel = null_sentinel ( opts) ;
17441744
17451745 offsets
17461746 . iter_mut ( )
17471747 . skip ( 1 )
17481748 . enumerate ( )
17491749 . for_each ( |( i, offset) | {
1750+ let sentinel = if union_array. is_valid ( i) {
1751+ 0x01
1752+ } else {
1753+ null_sentinel
1754+ } ;
1755+
17501756 let type_id = type_ids[ i] ;
17511757
17521758 let child_row_idx = match ( mode, offsets_buf) {
@@ -1760,7 +1766,7 @@ fn encode_column(
17601766 let child_row = child_rows[ type_id as usize ] . row ( child_row_idx) ;
17611767 let child_bytes = child_row. as_ref ( ) ;
17621768
1763- data[ * offset] = null_sentinel ;
1769+ data[ * offset] = sentinel ;
17641770
17651771 let type_id_byte = if opts. descending {
17661772 !( type_id as u8 )
You can’t perform that action at this time.
0 commit comments