@@ -12,14 +12,12 @@ use crate::array::convert::IntoArray;
1212use crate :: array:: operations:: ArrayOperationsImpl ;
1313use crate :: array:: validity:: ArrayValidityImpl ;
1414use crate :: array:: visitor:: ArrayVisitorImpl ;
15+ use crate :: arrays:: ConstantEncoding ;
1516use crate :: builders:: ArrayBuilder ;
1617use crate :: compute:: { ComputeFn , InvocationArgs , Output } ;
1718use crate :: stats:: { Precision , Stat , StatsProviderExt , StatsSetRef } ;
18- use crate :: vtable:: VTableRef ;
19- use crate :: {
20- Array , ArrayRef , ArrayStatistics , ArrayStatisticsImpl , ArrayVisitor , Canonical , Encoding ,
21- EncodingId ,
22- } ;
19+ use crate :: vtable:: { EncodingVTable , VTableRef } ;
20+ use crate :: { Array , ArrayRef , ArrayStatisticsImpl , ArrayVisitor , Canonical , Encoding , EncodingId } ;
2321
2422/// A trait used to encapsulate common implementation behaviour for a Vortex [`Array`].
2523pub trait ArrayImpl :
@@ -115,9 +113,8 @@ impl<A: ArrayImpl + 'static> Array for A {
115113
116114 // We know that constant array don't need stats propagation, so we can avoid the overhead of
117115 // computing derived stats and merging them in.
118- // TODO(ngates): skip the is_constant check here, it can force an expensive compute.
119116 // TODO(ngates): provide a means to slice an array _without_ propagating stats.
120- let derived_stats = ( !self . is_constant ( ) ) . then ( || {
117+ let derived_stats = ( !self . is_encoding ( ConstantEncoding . id ( ) ) ) . then ( || {
121118 let stats = self . statistics ( ) . to_owned ( ) ;
122119
123120 // an array that is not constant can become constant after slicing
0 commit comments