pub struct FileGroup { /* private fields */ }Expand description
Represents a group of partitioned files that’ll be processed by a single thread. Maintains optional statistics across all files in the group.
§Statistics
The group-level FileGroup::file_statistics field contains merged statistics from all files
in the group for the full table schema (file columns + partition columns).
Partition column statistics are derived from the individual file partition values:
min= minimum partition value across all files in the groupmax= maximum partition value across all files in the groupnull_count= 0 (partition values are never null)
This allows query optimizers to prune entire file groups based on partition bounds.
Implementations§
Source§impl FileGroup
impl FileGroup
Sourcepub fn new(files: Vec<PartitionedFile>) -> Self
pub fn new(files: Vec<PartitionedFile>) -> Self
Creates a new FileGroup from a vector of PartitionedFile objects
Sourcepub fn with_statistics(self, statistics: Arc<Statistics>) -> Self
pub fn with_statistics(self, statistics: Arc<Statistics>) -> Self
Set the statistics for this group
Sourcepub fn files(&self) -> &[PartitionedFile]
pub fn files(&self) -> &[PartitionedFile]
Returns a slice of the files in this group
pub fn iter(&self) -> impl Iterator<Item = &PartitionedFile>
pub fn into_inner(self) -> Vec<PartitionedFile>
pub fn is_empty(&self) -> bool
Sourcepub fn pop(&mut self) -> Option<PartitionedFile>
pub fn pop(&mut self) -> Option<PartitionedFile>
Removes the last element from the files vector and returns it, or None if empty
Sourcepub fn push(&mut self, partitioned_file: PartitionedFile)
pub fn push(&mut self, partitioned_file: PartitionedFile)
Adds a file to the group
Sourcepub fn file_statistics(&self, index: Option<usize>) -> Option<&Statistics>
pub fn file_statistics(&self, index: Option<usize>) -> Option<&Statistics>
Get the specific file statistics for the given index
If the index is None, return the FileGroup statistics
Sourcepub fn statistics_mut(&mut self) -> Option<&mut Statistics>
pub fn statistics_mut(&mut self) -> Option<&mut Statistics>
Get the mutable reference to the statistics for this group
Sourcepub fn split_files(self, n: usize) -> Vec<FileGroup>
pub fn split_files(self, n: usize) -> Vec<FileGroup>
Partition the list of files into n groups
Sourcepub fn group_by_partition_values(
self,
max_target_partitions: usize,
) -> Vec<FileGroup>
pub fn group_by_partition_values( self, max_target_partitions: usize, ) -> Vec<FileGroup>
Groups files by their partition values, ensuring all files with same partition values are in the same group.
Note: May return fewer groups than max_target_partitions when the
number of unique partition values is less than the target.
Trait Implementations§
Source§impl From<Vec<PartitionedFile>> for FileGroup
impl From<Vec<PartitionedFile>> for FileGroup
Source§fn from(files: Vec<PartitionedFile>) -> Self
fn from(files: Vec<PartitionedFile>) -> Self
Source§impl FromIterator<PartitionedFile> for FileGroup
impl FromIterator<PartitionedFile> for FileGroup
Source§fn from_iter<I: IntoIterator<Item = PartitionedFile>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = PartitionedFile>>(iter: I) -> Self
Auto Trait Implementations§
impl Freeze for FileGroup
impl !RefUnwindSafe for FileGroup
impl Send for FileGroup
impl Sync for FileGroup
impl Unpin for FileGroup
impl !UnwindSafe for FileGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more