pub trait PartitionRule: Sync + Send {
// Required methods
fn as_any(&self) -> &dyn Any;
fn partition_columns(&self) -> &[String];
fn find_region(&self, values: &[Value]) -> Result<RegionNumber>;
fn split_record_batch(
&self,
record_batch: &RecordBatch,
) -> Result<HashMap<RegionNumber, RegionMask>>;
}Required Methods§
fn as_any(&self) -> &dyn Any
fn partition_columns(&self) -> &[String]
Sourcefn find_region(&self, values: &[Value]) -> Result<RegionNumber>
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.
Sourcefn split_record_batch(
&self,
record_batch: &RecordBatch,
) -> Result<HashMap<RegionNumber, RegionMask>>
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.