@@ -13,10 +13,7 @@ use crate::ArrayRef;
1313use crate :: ExecutionCtx ;
1414use crate :: IntoArray ;
1515use crate :: aggregate_fn:: AggregateFnRef ;
16- use crate :: arrays:: Chunked ;
17- use crate :: arrays:: ChunkedArray ;
1816use crate :: arrays:: ConstantArray ;
19- use crate :: arrays:: chunked:: ChunkedArrayExt ;
2017use crate :: dtype:: DType ;
2118use crate :: expr:: Expression ;
2219use crate :: expr:: stats:: StatsProvider ;
@@ -115,26 +112,6 @@ impl ScalarFnVTable for StatFn {
115112 ) -> VortexResult < ArrayRef > {
116113 let input = args. get ( 0 ) ?;
117114 let dtype = stat_dtype ( options. aggregate_fn ( ) , input. dtype ( ) ) ?;
118-
119- // Recurse into each chunk so the output keeps per-chunk granularity (one constant
120- // per chunk) instead of collapsing to a single combined stat across the whole array.
121- // Per-chunk granularity is what makes the result useful for pruning: predicates can
122- // drop whole chunks at a time. Without this, we'd lose every chunk boundary as a
123- // pruning opportunity. Other encodings (zone maps, etc.) will need similar
124- // structure-preserving handling once they land.
125- if let Some ( chunked) = input. as_opt :: < Chunked > ( ) {
126- tracing:: trace!(
127- "stat({}) descending into ChunkedArray with {} chunks" ,
128- options. aggregate_fn( ) ,
129- chunked. nchunks( )
130- ) ;
131- let chunks = chunked
132- . iter_chunks ( )
133- . map ( |chunk| stat_array ( chunk, options. aggregate_fn ( ) , dtype. clone ( ) , chunk. len ( ) ) )
134- . collect :: < VortexResult < Vec < _ > > > ( ) ?;
135- return Ok ( ChunkedArray :: try_new ( chunks, dtype) ?. into_array ( ) ) ;
136- }
137-
138115 stat_array ( & input, options. aggregate_fn ( ) , dtype, args. row_count ( ) )
139116 }
140117}
0 commit comments