@@ -5,9 +5,6 @@ use std::hash::Hash;
55
66use num_traits:: PrimInt ;
77use rustc_hash:: FxBuildHasher ;
8- use vortex_array:: IntoArray ;
9- use vortex_array:: ToCanonical ;
10- use vortex_array:: arrays:: Primitive ;
118use vortex_array:: arrays:: PrimitiveArray ;
129use vortex_array:: arrays:: primitive:: NativeValue ;
1310use vortex_array:: dtype:: IntegerPType ;
@@ -22,10 +19,8 @@ use vortex_error::VortexResult;
2219use vortex_mask:: AllOr ;
2320use vortex_utils:: aliases:: hash_map:: HashMap ;
2421
25- use crate :: CompressorStats ;
2622use crate :: GenerateStatsOptions ;
2723use crate :: compressor:: rle:: RLEStats ;
28- use crate :: sample:: sample;
2924
3025#[ derive( Debug , Clone ) ]
3126pub struct DistinctInfo < T > {
@@ -244,24 +239,23 @@ impl IntegerStats {
244239 }
245240}
246241
247- impl CompressorStats for IntegerStats {
248- type ArrayVTable = Primitive ;
242+ impl IntegerStats {
243+ /// Generates stats with default options.
244+ pub fn generate ( input : & PrimitiveArray ) -> Self {
245+ Self :: generate_opts ( input, GenerateStatsOptions :: default ( ) )
246+ }
249247
250- fn generate_opts ( input : & PrimitiveArray , opts : GenerateStatsOptions ) -> Self {
248+ /// Generates stats with provided options.
249+ pub fn generate_opts ( input : & PrimitiveArray , opts : GenerateStatsOptions ) -> Self {
251250 Self :: generate_opts_fallible ( input, opts)
252251 . vortex_expect ( "IntegerStats::generate_opts should not fail" )
253252 }
254253
255- fn source ( & self ) -> & PrimitiveArray {
254+ /// Returns the underlying source array.
255+ #[ expect( clippy:: same_name_method) ]
256+ pub fn source ( & self ) -> & PrimitiveArray {
256257 & self . src
257258 }
258-
259- fn sample_opts ( & self , sample_size : u32 , sample_count : u32 , opts : GenerateStatsOptions ) -> Self {
260- let sampled =
261- sample ( & self . src . clone ( ) . into_array ( ) , sample_size, sample_count) . to_primitive ( ) ;
262-
263- Self :: generate_opts ( & sampled, opts)
264- }
265259}
266260
267261impl RLEStats for IntegerStats {
@@ -520,7 +514,6 @@ mod tests {
520514
521515 use super :: IntegerStats ;
522516 use super :: typed_int_stats;
523- use crate :: CompressorStats ;
524517
525518 #[ test]
526519 fn test_naive_count_distinct_values ( ) -> VortexResult < ( ) > {
0 commit comments