Documentation
¶
Index ¶
- func ConvertFoldExprToNormal(expr *plan.Expr) (*plan.Expr, error)
- func Filter(proc *process.Process, filters []*plan.Expr, ...) ([]int, error)
- func Prune(proc *process.Process, bat *batch.Batch, metadata partition.PartitionMetadata, ...) (partitionservice.PruneResult, error)
- func PrunePartitionByExpr(proc *process.Process, bat *batch.Batch, partition partition.Partition, ...) (*batch.Batch, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFoldExprToNormal ¶
ConvertFoldExprToNormal converts a folded expression to its normal form. Handles both constant and vector expressions, converting them to their literal representations.
func Filter ¶
func Filter( proc *process.Process, filters []*plan.Expr, metadata partition.PartitionMetadata, ) ([]int, error)
Filter determines which partitions should be accessed based on the given filters and partition metadata. It returns a slice of partition tables that match the filter conditions.
func Prune ¶
func Prune( proc *process.Process, bat *batch.Batch, metadata partition.PartitionMetadata, partitionIndex int32, ) (partitionservice.PruneResult, error)
Prune splits the input batch into multiple batches based on partition expressions. It is used when PrimaryKeysMayBeModified, during DELETE operations, or when inserting data. For each partition defined in the metadata, it evaluates the partition expression and creates a new batch containing only the rows that match that partition's criteria.
Parameters:
- proc: The process context
- bat: The input batch to be partitioned
- metadata: Contains partition definitions and expressions
- partitionIndex: The column index used for partitioning (-1 if not applicable)
Returns:
- PruneResult: Contains the split batches and their corresponding partition information
- error: Any error that occurred during the partitioning process
func PrunePartitionByExpr ¶
func PrunePartitionByExpr( proc *process.Process, bat *batch.Batch, partition partition.Partition, partitionIndex int32, ) (*batch.Batch, error)
PrunePartitionByExpr evaluates a partition expression against the input batch and returns a new batch containing only the rows that match the partition criteria.
The function creates a new batch with the same structure as the input batch and copies only the rows that satisfy the partition expression. If partitionIndex is specified, it adjusts the expression to use the correct column position.
Parameters:
- proc: The process context
- bat: The input batch to be filtered
- partition: Contains the partition expression and metadata
- partitionIndex: The column index used for partitioning (-1 if not applicable)
Returns:
- *batch.Batch: A new batch containing only the rows that match the partition criteria
- error: Any error that occurred during the evaluation
Types ¶
This section is empty.