@@ -45,11 +45,8 @@ use crate::arrays::VarBinVTable;
4545use crate :: arrays:: VarBinViewVTable ;
4646use crate :: builders:: ArrayBuilder ;
4747use crate :: compute:: ComputeFn ;
48- use crate :: compute:: Cost ;
4948use crate :: compute:: InvocationArgs ;
50- use crate :: compute:: IsConstantOpts ;
5149use crate :: compute:: Output ;
52- use crate :: compute:: is_constant_opts;
5350use crate :: expr:: stats:: Precision ;
5451use crate :: expr:: stats:: Stat ;
5552use crate :: expr:: stats:: StatsProviderExt ;
@@ -368,28 +365,8 @@ impl dyn Array + '_ {
368365 self . as_opt :: < V > ( ) . is_some ( )
369366 }
370367
371- pub fn is_constant ( & self ) -> bool {
372- let opts = IsConstantOpts {
373- cost : Cost :: Specialized ,
374- } ;
375- is_constant_opts ( self , & opts)
376- . inspect_err ( |e| tracing:: warn!( "Failed to compute IsConstant: {e}" ) )
377- . ok ( )
378- . flatten ( )
379- . unwrap_or_default ( )
380- }
381-
382- pub fn is_constant_opts ( & self , cost : Cost ) -> bool {
383- let opts = IsConstantOpts { cost } ;
384- is_constant_opts ( self , & opts)
385- . inspect_err ( |e| tracing:: warn!( "Failed to compute IsConstant: {e}" ) )
386- . ok ( )
387- . flatten ( )
388- . unwrap_or_default ( )
389- }
390-
391368 pub fn as_constant ( & self ) -> Option < Scalar > {
392- self . is_constant ( ) . then ( || self . scalar_at ( 0 ) )
369+ self . as_opt :: < ConstantVTable > ( ) . map ( |a| a . scalar ( ) . clone ( ) )
393370 }
394371
395372 /// Total size of the array in bytes, including all children and buffers.
0 commit comments