@@ -610,6 +610,40 @@ mod tests {
610610 Ok ( ( ) )
611611 }
612612
613+ /// Regression test for <https://github.com/vortex-data/vortex/issues/7074>.
614+ ///
615+ /// A chunked all-true bool array with an empty first chunk returned min=false because
616+ /// `accumulate_bool` on the empty chunk incorrectly merged min=false,max=false into the
617+ /// partial state.
618+ #[ test]
619+ fn test_bool_chunked_with_empty_chunk ( ) -> VortexResult < ( ) > {
620+ let mut ctx = LEGACY_SESSION . create_execution_ctx ( ) ;
621+
622+ let empty = BoolArray :: new ( BitBuffer :: from ( [ ] . as_slice ( ) ) , Validity :: NonNullable ) ;
623+ let chunk1 = BoolArray :: new (
624+ BitBuffer :: from ( [ true , true ] . as_slice ( ) ) ,
625+ Validity :: NonNullable ,
626+ ) ;
627+ let chunk2 = BoolArray :: new (
628+ BitBuffer :: from ( [ true , true , true ] . as_slice ( ) ) ,
629+ Validity :: NonNullable ,
630+ ) ;
631+ let chunked = ChunkedArray :: try_new (
632+ vec ! [ empty. into_array( ) , chunk1. into_array( ) , chunk2. into_array( ) ] ,
633+ DType :: Bool ( Nullability :: NonNullable ) ,
634+ ) ?;
635+
636+ let result = min_max ( & chunked. into_array ( ) , & mut ctx) ?;
637+ assert_eq ! (
638+ result,
639+ Some ( MinMaxResult {
640+ min: Scalar :: bool ( true , Nullability :: NonNullable ) ,
641+ max: Scalar :: bool ( true , Nullability :: NonNullable ) ,
642+ } )
643+ ) ;
644+ Ok ( ( ) )
645+ }
646+
613647 #[ test]
614648 fn test_varbin_all_nulls ( ) -> VortexResult < ( ) > {
615649 let array = VarBinArray :: from_iter (
0 commit comments