Skip to main content

PartitionRule

Trait PartitionRule 

Source
pub trait PartitionRule: Sync + Send {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn partition_columns(&self) -> Vec<String>;
    fn find_region(&self, values: &[Value]) -> Result<RegionNumber>;
    fn split_record_batch(
        &self,
        record_batch: &RecordBatch,
    ) -> Result<HashMap<RegionNumber, RegionMask>>;
}

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn partition_columns(&self) -> Vec<String>

Source

fn find_region(&self, values: &[Value]) -> Result<RegionNumber>

Finds the target region by the partition values.

Note that the values should have the same length as the partition_columns.

Source

fn split_record_batch( &self, record_batch: &RecordBatch, ) -> Result<HashMap<RegionNumber, RegionMask>>

Split the record batch into multiple regions by the partition values. The result is a map from region mask in which the array is true for the rows that match the partition values. Region with now rows selected may not appear in result map.

Implementors§